SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
In this presentation to the Dallas/Fort Worth Joomla User Group, we covered the basics of custom Joomla templates for Joomla 2.5. We discussed:
The Basics of Joomla Templates
- Overall File Structure
- templateDetails.xml file
- index.php file
Some Advanced Template Topics
- HTML Overrides to override the output of Joomla components and modules
- Template Parameters to use in the Template Styles
- Language Overrides
In this presentation to the Dallas/Fort Worth Joomla User Group, we covered the basics of custom Joomla templates for Joomla 2.5. We discussed:
The Basics of Joomla Templates
- Overall File Structure
- templateDetails.xml file
- index.php file
Some Advanced Template Topics
- HTML Overrides to override the output of Joomla components and modules
- Template Parameters to use in the Template Styles
- Language Overrides
1.
Creating Custom Templates
for Joomla! 2.5
Dallas/Fort Worth Joomla User Group
January 14, 2013
www.KatalystCreativeGroup.com
2.
A Bit About Me: Don Cranford
• Partner / Lead Developer at Katalyst Creative
Group
• Web Design/Dev, Branding, Content, SEO
• Started using Joomla! (Mambo) in 2004
• Joomla! is our primary tool, but also do some
WordPress and Drupal.
• Custom Joomla! templates and extensions.
www.KatalystCreativeGroup.com
4.
Today We’ll Cover:
• Advanced Topics
• HTML Overrides
• Parameters
• Language Overrides
• Installation
www.KatalystCreativeGroup.com
5.
Creating Custom Templates for Joomla! 2.5
THE BASICS
6.
Template File Structure
• Required Files:
• index.php
• templateDetails.xml
• template_thumbnail.png
• css folder
• Folder must be named “css”
www.KatalystCreativeGroup.com
7.
Template File Structure
• Optional Files
• html (folder… used for overrides)
• language (for language overrides)
• error.php (to override 404… errors page layout)
• component.php (to override component layout)
• template_preview.png
www.KatalystCreativeGroup.com
8.
Template File Structure
• Show image here…
www.KatalystCreativeGroup.com
9.
templateDetails.xml
• Used during the installation process
• Tells what files to install
• Provides the optional parameters
• Used in configuring the style options.
www.KatalystCreativeGroup.com
14.
index.php
• The primary file that controls the layout.
• Can use regular php within the file
• Uses tags (<jdoc include type=“…” />) to
determine where to output different pieces
• <jdoc include type=“head” />
• <jdoc include type=“component” />
• <jdoc include type=“module” name=“*position+” />
• <jdoc include type=“message” />
www.KatalystCreativeGroup.com
15.
Creating Custom Templates for Joomla! 2.5
ADVANCED TOPICS
16.
Html Overrides: What Are They?
• Override the layout for any MVC components
and modules
• MVC = Model, View, Controller
• Gives Joomla tremendous flexibility!
www.KatalystCreativeGroup.com
17.
Html Overrides: How To?
• Create folder name that corresponds to
component or module under html
• Create folder name that corresponds to the
view name (ie. html/com_content/article)
• Create default.php file
• Can copy from the original as a starting point
• Ex: html/com_content/article/default.php
www.KatalystCreativeGroup.com
18.
Template Parameters
• Derived from the templateDetails.xml
• <config><fields name=“params”>…</fields></config>
• Each parameter defined as a field
<field name=“…” type=“text” default=“…”
label=“*language string from language file+”
description=“*language string+” />
www.KatalystCreativeGroup.com
19.
Template Parameters
• Access in the index.php with:
• $this->params->get(‘*parameter field name+');
www.KatalystCreativeGroup.com
20.
Template Parameters
Configure the parameters in the Joomla Template admin
www.KatalystCreativeGroup.com
21.
Language: Files & Overrides
• Provides the text for the language strings in
the template
• Two files in the language/en-GB/ folder
• en-GB.tpl_mytemplate1.ini
• Language strings used in the template
• en-GB.tpl_mytemplate1.sys.ini
• Language strings used in installation and admin
www.KatalystCreativeGroup.com
22.
Creating Custom Templates for Joomla! 2.5
INSTALLATION
23.
Installation
• Create archive (.zip or .tar.gz) file
• Install like any other extension in Control Panel
• Extensions >> Extension Manager >> Install
• Discover
• Copy folder and files to templates directory
• Extensions >> Extension Manager >> Discover
• Click Discover button
• Select and install
www.KatalystCreativeGroup.com
24.
Creating Custom Templates for Joomla! 2.5
FOR MORE GUIDANCE