4. index.php <?php/* The following line denies direct access to this PHP file */defined('_JEXEC') or die;/* The following line loads the MooTools JavaScript Library */JHtml::_('behavior.framework', true);/* The following line gets the application object for things like displaying the site name */$app = JFactory::getApplication();?> <?php echo '<?'; ?>xml version="1.0" encoding="<?php echo $this->_charset ?>"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml " xml:lang="<?php echo $thi s->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
5. index.php head <head> <!-- The following JDOC Head tag loads all the header and meta information from your site config and content. --> <jdoc:include type="head" /> <!-- The following line loads the template CSS file located in the template folder. --> <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" /> </head>
7. Module Tag Styles Menus don’t need div wrappers so we use: <jdoc:include type="modules" name="menu" style="none" /> Banners need the wrappers so we use: <jdoc:include type="modules" name="banner" style="xhtml" />
10. Don’t forget debug! Place a debug module position right before the </body> <jdoc:include type="modules" name="debug" style="xhtml" />
11. Content Conditional If Sidebar “ width-65” will make the content smaller and float left, so only use if there’s a module in sidebar: <div id="content" class="width-65"> becomes: <div id="content" <?php if($this->countModules('sidebar')) : ?> class="width-65" <?php endif; ?>>
13. Useful Variables /* The following 5 lines get current page variables */$option = JRequest::getCmd('option', '');$view = JRequest::getCmd('view', '');$layout = JRequest::getCmd('layout', '');$task = JRequest::getCmd('task', '');$itemid = JRequest::getCmd('Itemid', '');/* The following 6 lines set a variable to true if we're on the site default menu item (home) */$menu = & JSite::getMenu();if ($menu->getActive() == $menu->getDefault()) :$active = "homepage";else:$active = "subpage";endif;
14. component.php <?php/* The following line denies direct access to this PHP file */defined('_JEXEC') or die;/* The following line loads the MooTools JavaScript Library */JHtml::_('behavior.framework', true);/* The following line gets the application object for things like displaying the site name */$app = JFactory::getApplication();?><?php echo '<?'; ?>xml version="1.0" encoding="<?php echo $this->_charset ?>"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "><html xmlns=" http://www.w3.org/1999/xhtml " xml:lang="<?php echo $thi s->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" > <head> <!-- The following JDOC Head tag loads all the header and meta information from your site config and content. --> <jdoc:include type="head" /> <!-- The following line loads the template CSS file located in the template folder. --> <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" /> </head> <body id="modal"> <jdoc:include type="message" /> <jdoc:include type="component" /> </body> </html>
15. component.php <?php/* The following line denies direct access to this PHP file */defined('_JEXEC') or die;/* The following line loads the MooTools JavaScript Library */JHtml::_('behavior.framework', true);/* The following line gets the application object for things like displaying the site name */$app = JFactory::getApplication();?><?php echo '<?'; ?>xml version="1.0" encoding="<?php echo $this->_charset ?>"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "><html xmlns=" http://www.w3.org/1999/xhtml " xml:lang="<?php echo $thi s->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" > <head> <!-- The following JDOC Head tag loads all the header and meta information from your site config and content. --> <jdoc:include type="head" /> <!-- The following line loads the template CSS file located in the template folder. --> <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" /> </head> <body id="modal"> <jdoc:include type="message" /> <jdoc:include type="component" /> </body> </html>
16. Echo Variables as Body Classes <body id="site" class="<?php echo $option . " view-" . $view . " layout-" . $layout . " task-" . $task . " itemid-" . $itemid . " " . $active;?>"> which will result in something like: <body id="site" class="com_content view-category layout-blog task- itemid-65 homepage"> which can be extremely useful styling hooks when the markup of the page lacks taxonomy
21. templateDetails.xml <name>minis</name> <version>1.0</version> <creationDate>09/07/2011</creationDate> <author>Kyle Ledbetter and Andy Miller</author> <authorEmail> [email_address] </authorEmail> <authorUrl> http://minisandfriends.org < /authorUrl> <copyright>Co pyright 2011 Minis and Friends. All rights reserved.</copyright> <description>Minis and Friends Template</description>
- make sure to include the “message” for system messages - “component” loads your main Joomla component - place modules before and after component for later convenience
- this will allow the debug to appear if turned on, and is a great module position for javascript to be executed at the end of the page (like Google analytics)
- this is used to load modal windows and for loading the component without the template around it - basically a stripped down version of your index.php
- this is used to load modal windows and for loading the component without the template around it - basically a stripped down version of your index.php
- don’t use an & sign! must be &amp; or “and”
- include entire folders w/ <folder>
- must be square - best if transparent gif
- generates favicon.ico for you
- directories can’t be empty, at least drop in an index.html
- recommend BetterZip on OSX to make sure you don’t zip hidden files - zip the files, not the surrounding folder
- recommend BetterZip on OSX to make sure you don’t zip hidden files - zip the files, not the surrounding folder
- this is after setting up categories, blank articles, menus, and modules