joomla template development

37
TEMPLATE DEVELOPMENT Robert Jacobi, Arc Technology Group 1 Tuesday, February 17, 2009

Upload: linda-coonen

Post on 17-May-2015

11.132 views

Category:

Technology


0 download

DESCRIPTION

How to develop a template using Joomla by Robert Jacobi, ARC Technology Group for JoomlaChicago User Group. February, 2009.

TRANSCRIPT

Page 1: Joomla Template Development

TEMPLATE DEVELOPMENTRobert Jacobi, Arc Technology Group

1Tuesday, February 17, 2009

Page 2: Joomla Template Development

THE PIECES

• Directory Structure

• templateDetails.xml

• params.ini

• index.php

• style.css

2Tuesday, February 17, 2009

Page 5: Joomla Template Development

IMPORTANT FILES

• templateDetails.xml*

• index.php*

• template_thumbnail.png

• params.ini

• style.css

• index.html

4Tuesday, February 17, 2009

Page 6: Joomla Template Development

IMPORTANT FILES

• templateDetails.xml*

• index.php*

• template_thumbnail.png

• params.ini

• style.css

• index.html

4Tuesday, February 17, 2009

Page 7: Joomla Template Development

TEMPLATEDETAILS.XML

• <?xml version="1.0" encoding="utf-8"?>

• <!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN" "http://dev.joomla.org/xml/1.5/template-install.dtd">

• <install version="1.5" type="template">

5Tuesday, February 17, 2009

Page 8: Joomla Template Development

DESCRIPTION ELEMENTS

• <name>tba</name>

• <creationDate>2009-02-01</creationDate>

• <author>Arc Technology Group</author>

• <authorEmail>[email protected]</authorEmail>

• <authorUrl>http://www.arctg.com</authorUrl>

• <copyright>Arc Technology Group</copyright>

6Tuesday, February 17, 2009

Page 9: Joomla Template Development

FILES AND POSITIONS

• <files><filename>relative_path/file_name</filename></files>

• <positions><position>name</position></positions>

7Tuesday, February 17, 2009

Page 10: Joomla Template Development

PARAMS

• http://docs.joomla.org/Tutorial:Template_parameters

• <params><param ...>...</param></params>

8Tuesday, February 17, 2009

Page 11: Joomla Template Development

PARAMS AND PARAMS.INI

• <params>

• <param name="templateColor" type="list" default="white" label="Template Color" description="Choose the template color."> <option value="white">White</option> <option value="black">Black</option></param>

• </params>

9Tuesday, February 17, 2009

Page 12: Joomla Template Development

PARAMS AND PARAMS.INI

• templateColor=white

10Tuesday, February 17, 2009

Page 13: Joomla Template Development

PARAMS AND PARAMS.INI

• templateColor=white

10Tuesday, February 17, 2009

Page 14: Joomla Template Development

INDEX.PHP

• Restrict access and describe document

• <?php defined( '_JEXEC' ) or die( 'Restricted access' );?>

• <!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 $this->language; ?>" lang="<?php echo $this->language; ?>" >

11Tuesday, February 17, 2009

Page 15: Joomla Template Development

INDEX.PHP

• Add header code and css

• <head>

• <jdoc:include type="head" />

• <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/mynewtemplate/css/style.css" type="text/css" />

• </head>

12Tuesday, February 17, 2009

Page 16: Joomla Template Development

INDEX.PHP

• Add modules and component

• <body>

• <jdoc:include type="modules" name="top" />

• <jdoc:include type="component" />

• <jdoc:include type="modules" name="footer" />

• </body></html>

13Tuesday, February 17, 2009

Page 17: Joomla Template Development

INDEX.PHP

• Add modules and component

• <body>

• <jdoc:include type="modules" name="top" />

• <jdoc:include type="component" />

• <jdoc:include type="modules" name="footer" />

• </body></html>

13Tuesday, February 17, 2009

Page 18: Joomla Template Development

ZIP IT!

• Zip up the new template directory

• Install template on to your Joomla instance

14Tuesday, February 17, 2009

Page 19: Joomla Template Development

ZIP IT!

• Zip up the new template directory

• Install template on to your Joomla instance

14Tuesday, February 17, 2009

Page 20: Joomla Template Development

ZIP IT!

• Zip up the new template directory

• Install template on to your Joomla instance

14Tuesday, February 17, 2009

Page 21: Joomla Template Development

TAYLOR BRUCE INDEX.PHP

• Header changes from basic template

• <link rel="stylesheet" href="<?php echo $this->baseurl . '/

templates/' . $this->template . '/css/style.css' ?>" type="text/css" />

• <link rel="stylesheet" href="<?php$tplColor = $this->params->get( 'templateColor' );echo $this->baseurl . '/templates/' . $this->template . '/css/' . $tplColor . '.css';?>" type="text/css" />

15Tuesday, February 17, 2009

Page 22: Joomla Template Development

TAYLOR BRUCE INDEX.PHP

• <?php echo $this->baseurl . '/templates/' . $this->template . '/images/taylor-bruce-logo.gif' ?>

• <?php if($this->countModules('debug')) : ?> <jdoc:include type="modules" name="debug" /><?php endif; ?>

• <?php echo JHTML::_('date', 'now', '%Y' ) ?>

16Tuesday, February 17, 2009

Page 23: Joomla Template Development

TAYLOR BRUCE INDEX.PHP

• <?php echo $this->baseurl . '/templates/' . $this->template . '/images/taylor-bruce-logo.gif' ?>

• <?php if($this->countModules('debug')) : ?> <jdoc:include type="modules" name="debug" /><?php endif; ?>

• <?php echo JHTML::_('date', 'now', '%Y' ) ?>

16Tuesday, February 17, 2009

Page 24: Joomla Template Development

ADD IMAGES

• Are these listed in templateDetails.xml?

17Tuesday, February 17, 2009

Page 25: Joomla Template Development

ADD IMAGES

• Are these listed in templateDetails.xml?

17Tuesday, February 17, 2009

Page 26: Joomla Template Development

ADD CSS

• Make sure about templateDetails.xml

• style.css

• black.css

• white.css

• editor.css

18Tuesday, February 17, 2009

Page 27: Joomla Template Development

ADD CSS

• Make sure about templateDetails.xml

• style.css

• black.css

• white.css

• editor.css

18Tuesday, February 17, 2009

Page 28: Joomla Template Development

ADD CSS

• Make sure about templateDetails.xml

• style.css

• black.css

• white.css

• editor.css

18Tuesday, February 17, 2009

Page 29: Joomla Template Development

ADD CSS

• Make sure about templateDetails.xml

• style.css

• black.css

• white.css

• editor.css

18Tuesday, February 17, 2009

Page 30: Joomla Template Development

ADD CSS

• Make sure about templateDetails.xml

• style.css

• black.css

• white.css

• editor.css

18Tuesday, February 17, 2009

Page 31: Joomla Template Development

TBA HOME PAGE

• FrontPage SlideShow (Commercial)

• Extended Menu (GPL)

19Tuesday, February 17, 2009

Page 32: Joomla Template Development

TBA HOME PAGE

• FrontPage SlideShow (Commercial)

• Extended Menu (GPL)

19Tuesday, February 17, 2009

Page 33: Joomla Template Development

ADVANCED TOPICS STYLES

• Module Styles

• none. Output the raw Module content with no wrapping.

• table. Output the module in a table.

• horz. Output the module as a table inside an outer table.

• xhtml. Output the module wrapped in div tags.

• rounded. Output the module wrapped in nested div tags to support rounded corners.

20Tuesday, February 17, 2009

Page 34: Joomla Template Development

ADVANCED TOPICS PARAMETERS

• For template customization

• Common in commercial templates

21Tuesday, February 17, 2009

Page 35: Joomla Template Development

ADVANCED TOPICS PARAMETERS

• For template customization

• Common in commercial templates

21Tuesday, February 17, 2009

Page 37: Joomla Template Development

THANK YOU

23Tuesday, February 17, 2009