Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Blank Template Snippets for Joomla! 2.5
# index.php :: load the global joomla header
# between <head> and </head>
<jdoc:include type="head" />
# index.php :: output of the system messages
# between <body> and </body>
<jdoc:include type="message" />
# index.php :: article and component output
# between <body> and </body>
<jdoc:include type="component" />
# index.php :: module output of "menu", which have to be mentioned in templateDetails.xml
# between <body> and </body>
<jdoc:include type="modules" name="menu" style="xhtml" />
# templateDetails.xml :: creation of a new module position called "menu";
# between <positions> and </positions>
<position>menu</position>
# index.php :: output of the base url
# between <?php and ?>
echo $this->baseurl;
# index.php :: load application (line 1) and output of sitename (line 2)
# between <?php and ?>
$app = JFactory::getApplication();
echo $app->getCfg('sitename');
# index.php :: if construct; true, if there is published a module on position "menu"
# between <?php and ?>
if ($this->countModules( 'menu' )) :
# index.php :: if construct; true, if the http user agent is a mobile device
# between <?php and ?>
if(eregi('iphone|ipod|opera mini|blackberry|android', $_SERVER['HTTP_USER_AGENT'])) :
# index.php :: extend the if statement from above to execute another statement
# between <?php and ?>
else :
# index.php :: closing the if statement
# between <?php and ?>
endif;
# index.php :: disappear the generator tag
# between <?php and ?>
$this->setGenerator(null);
# index.php :: load the application (line 1), get the params (line 2)
# and get the page class from the current menu entry (line 3)
# between <?php and ?>
$app = JFactory::getApplication();
$params = $app->getParams();
$pageclass = $params->get('pageclass_sfx');
# index.php :: load the modal behavior
# between <?php and ?>
JHTML::_('behavior.modal');
# index.php :: output source in modal window
# between <html> and </html> or in articles and modules
<a class="modal"></a>
... to be continued ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.