joomla! day uk 2009 template design
TRANSCRIPT
Slide 1
Joomla! Day UK 2009
Joomla! Day UK 2009
Template Design
Chris Davenport
Joomla! Core Team
Providing a flexible platform for digital publishing and collaboration.
Understanding templates
Joomla has an incredibly powerful template system,yet surprisingly few template designersactually make use of this power.
Use a reset script
Tip: Always use a browser reset script.
eg. Eric Meyer's reset.css
http://meyerweb.com/eric/tools/css/reset/
You can be clever and use the Joomla API:
$reset = '/templates/' . $this->template . '/css/reset.css';$this->addStylesheet( $this->baseurl . $reset );
Or use a CSS framework
Examples:http://www.blueprintcss.orghttp://developer.yahoo.com/yui/grids/http://elements.projectdesigns.org/http://www.wymstyle.org/en/http://www.yaml.de/en/http://code.google.com/p/css-boilerplate/
Template execution
Template execution is a two-phase process.
Phase 1: All PHP code is executed.
Phase 2: All jdoc:include statements are replaced.
See: http://docs.joomla.org/How_are_templates_executed%3F
Template execution
In phase 1 all the PHP code is executedIn phase 2 all the jdoc:include statements are replacedBefore execution
After Phase 1
Main Menu
-
...... other HTML omitted ......
Template execution
After Phase 2
What does it mean?
Calls to $this->addScript() and similar API calls can be placed anywhere in the template.
jdoc:include statements can be constructed programmatically.
Example: