Joomla Day Austin Part 4

Preview:

DESCRIPTION

Joomla Day Austin Texas 2011 - Part 4 features Alex Andreae and Jeremy Wilken doing Joomla extensions development as well as Joe LeBlanc and Brian Edgerton doing Joomla site deployment

Citation preview

Part IV

Intermission

Joomla Extension Development

Alex Andreae, SourceCoastJeremy Wilken, Gnome on the run

Joomla!Day AustinSeptember 2011

It isn't always as simple as installing...

• It takes energy• It takes time• It takes thought• It takes knowledge• It takes....

Extension Types

• Components• Modules• Plugins

Free or Paid?

Should I buy extensions or use free ones?

• Free or paid doesn't make it better• If an extension saves you hours...• Focus on what works, not what is free• Consider donating for free extensions

The latest is (often) greatest

Does keeping my extensions updated matter?

• Extensions can be vulnerable• Observe release cycle for stable releases• Grab the rss feeds from favorite extensions• Watch the vulnerable extensions listhttp://docs.joomla.org/Vulnerable_Extensions_List

Install with caution

Should I install all 'willy-nilly'?

• No, no, and never• Check if its in active development• Evaluate extensions on a test site• Always backup first

Keep a clean site

Is there a problem with leaving extensions I'm not using yet?

• Uninstall anything you aren't using• Check they actually uninstalled• Take notes about what worked

Finding good extensions

How do I find a good extension?

• Search the JED with a regular search engine• Search on multiple terms and combinations• Talk with others about what they use• Read JED reviews with a grain of salt

Research the authors

What extensions can I trust and use?

• Is there documentation?• Is there support?• Is there a community around it?• Does the author know Joomla?

Simpler is (usually) better

How many extensions can I use?

• Try not to install any while building• Install the necessary extensions• The more extensions, the less cohesive the

site will be• Avoid overly complex extensions for simple

problems

Use the same extensions

Should I use the same extensions always?

• Find your favorites and stick with them• Makes it easier to use• Easier to track updates• You can become an expert using them

Checklist for extensions

• Will this solve problems?• Has it been updated recently?• Do I trust the author?• Have I tested it on a test site?• Does it uninstall cleanly from the test site?• Do you have the latest version?• Do I have a backup before installing?

Custom extensions

When should I pay to have a custom extension made?

• Designed to exact requirements• Simpler to use• Need a realistic budget• Can make the difference in a site

Give back

• Help on an extension's forum• Post a review• Provide a donation• Send constructive feedback• Share customizations or tweaks• Share on a blog/social media

Joomla Development

It’s Easier Than You Think

SourceCoastAlex Andreae

Owner / Developer

JFBConnectFull Facebook Integration Suite for Joomla

* Facebook Authentication* Facebook Page Tab / Canvas Integration* Like, Comment, Fanbox, Recommendations & more* Customizeable Profile Import Into* JomSocial, Community Builder, Kunena, K2, Agora* Lots more

Over 60 straight 5-star reviews on the JED

Overview

•Joomla Development Flow

•Module Structure

•API Overview

Joomla - MVC

•MVC(t) - Model View Controller (template)

• Controller - Sets up environment for the display

•Model - Data interface

•Generally to the database, but can ‘create’ data if necessary

• View - Uses the model to get data to display

• TTemplate - Override-able disaplay output

Modules• Linear code execution

• VC(t) (no real model necessary)

• Uses a ‘helper.php’ file for additional function calls

• Can be model-like, but modules don’t have DB tables

• Files:

• mod_<modulename>.php and .xml

• helpers/helper.php

• tmpl/default.php

Module Parameters

Module - Entry Point

Module - Helper File

Module Template - Address

Module Template - Contact Form

Joomla API Overview

Joomla API• http://api.joomla.com

• Left side, select “Joomla-Platform” package

• Bookmark, cuddle up to, and love this page

• “Classes” describes

• JFactory - Get instantiations of common classes

• JRoute - Get URL for specific component/view/task

• “Application” describes

• Every other Joomla function

JObject• All Joomla classes derived from (You should

too)

• Easy getter/setter methods

• $obj->set(‘var’, ‘value’); // Set a variable

• $obj->get(‘var’, ‘default’); // Get a value

• $obj->def(‘var’, ‘default’); // Set a default

• $obj->toString(); // Great for debugging - no print_r($obj) required!

JUser Object• $user = JFactory::getUser(); // logged in user

• $user = JUser::getInstance($id);

• $id = UID or username

• Once fetched:

• if ($user->guest)

• $user->get(‘username’); //id, fullname, lastvisitDate, etc

• It’s derived from JObject!

JFactory - Database

• $dbo =& JFactory::getDBO(); // Get the database handle

• Functions describe in JDatabase & JDatabaseMySQL(i)

• $query = $dbo->getQuery(true); // New Query$query->select(‘id, username, email’);$query->from(‘#__users’);$query->where(‘username=’.$dbo->quote($username); // No shenanigans!$dbo->setQuery($query);

• $user->dbo->loadObject(); // objectList, array, arrayList, result, etc

• Can use InsertObject function (or raw SQL) to add rows to database

JText• Text translation from language files

• JText::_(‘MOD_CONTACT_HIYA’);

• Searches loaded language files in last loaded order

• Searches for first, exact, upper case version

• If found, use transation; If not, use text directly

• To Include more langauge files:

• $lang =& JFactory::getLanguage();

• $lang->load(‘mod_contact’); // Add your extension

JRequest• JRequest::getVar(‘name’, ‘default’,

‘POST’);

•Can be risky depending on use. Should use sanitized methods below

• JRequest::getInt(‘name’, 4); // Integers only w/ default of 4

• JRequest::getCmd(‘task’); // strips \ . /

• JRequest::getString(‘name’); // No nasty HTML

Questions?

Joomla Site Deployment

Joe LeBlancBrian Edgerton, Edge Webworks

Joomla!Day AustinSeptember 15, 2011

My Site Is (Almost) Ready for the World to See. What Now?

• Map out a deployment strategy

• Pick a good host (if you haven't already)

• Transfer and setup your site on your live server

• Optimize your site for production

Deployment

The Golden Rule: Use a development or staging site.

Why can't I just keep making changes on my live site?

• Nothing is stopping you, but you may regret that decision.

• Using a development site can save you hours of frustration.

Deployment

The Golden Rule: Use a development or staging site.

Benefits

• Gives you a chance to make adjustments and tweaks before your changes are visible to the world

• Allows you to fix any unintended consequences or unforeseen problems

• Absolutely necessary for any ongoing changes or development that will take extended amounts of time

Deployment

The Golden Rule: Use a development or staging site.

OK, I get it. Now how do I set up a dev site?

• Maintain a copy of your site anywhere you'd like

• Somewhere on the same server is ideal 

• Consider password protecting your dev site

Transferring Your Site

Use an FTP client to transfer your site files between servers

Hosting: Shared

Hosting: VPS

Hosting: Cloud

Hosting: Dedicated

Hosting

Make sure you're getting managed hosting

(unless you're a sysadmin and you know what you're doing)

Caching

Caching

Caching

CompressingEnable GZip compression to shrink the data sent from the server to browser

Check Your Resources!Missing resources can affect your search engine rankings.

YSlow

Disabling

Disable or remove unused extensions

Disabling

Disallow frontend registration(User Manager > Options)

Disabling

Use .htaccesshttp://docs.joomla.org/Htaccess_examples_(security)

Launch

Copy files from dev to live

Launch

Copy database from dev to live

Launch

Adjust configuration.php

Launch

...or use AkeebaBackup!

Wait, you're not done! - Updates

• Sign up for security alerts on joomla.org

• Update through Extension Manager

• Stay up to date on 3rd party extensions

For bonus points: Where are you going to apply these updates first?

Wait, you're not done! - Backup

AkeebaBackup is great

Wait, you're not done! - Backup

Test your backup

Wait, you're not done! - Backup

Schedule your backup

Okay, now you're done

minisandfriends.com

Credits

• Beach Cozumel - Riviera Maya Ocean View: http://www.flickr.com/photos/grandvelasrivieramaya/3180227438/ (CC BY-SA 2.0)

• Server physikstudenten.de http://www.flickr.com/photos/rosenkranz/82624587/ (CC BY-SA 2.0)

• Website icon by Bogdan Mihaiciuc http://bogo-d.deviantart.com/ (CC BY 3.0)

• servers http://www.flickr.com/photos/aswirlymatrix/15138579/ (CC BY-NC 2.0)

• PHP Logo: http://en.wikipedia.org/wiki/File:PHP-logo.svg

Questions?

Joomla Day Austin Closing

ConversationsRyan Ozimek, President of OSM, PICnet

John Coonen, CMS ExpoSeptember 15, 2011

JOOMLA!DAY AUSTIN

Thanks for coming!

Credits (in order of appearance)

Event Planner MELINDA LEDBETTERSite Planner CORY WEBBSite Planner JEN KRAMER

Template Designer ANDY MILLERTemplate Designer KYLE LEDBETTERExtension Developer ALEX ANDREAEExtension Developer JEREMY WILKEN

Site Deployment JOE LEBLANCSite Deployment BRIAN EDGERTONClosing Cheerleader RYAN OZIMEKClosing Cheerleader JOHN COONEN

Photographer ILSUN PARKVideographer KEN DVORAK

Minis and Friends SALLY IWANSKI

LET THE PARTY START!Join us afterwards at

IRON CATCUS(right next door)

and afterwards across the street atMAGGIE MAE’Sfor Music & Fun!

Thanks so much to the sponsors:eBay

Rocket ThemeRed Component

JoomlArtRochen

Pixel PraiseSourceCoast

Gisclair Media (Larry!)JoomlaShowroom

And YOU our wonderfulAttendees!

More credits to enjoy the music :)

Venue ALAMO DRAFTHOUSE

Content Management System JOOMLA!

Town AUSTIN, TEXAS

Country UNITED STATES

...What else, let’s see

...

Did we thank beer? Thanks beer!

Joomla!Day Austin 2011

That’s a wrap.