|
Jun 29
2008
|
Template Overrides - part 2Posted by: Bill Tomczak on Jun 29, 2008 Tagged in: templates , joomla 1.5
|
|
You've been designing your new website, creating a template to your client's specifications. All is going well. They are making use of the weblinks component for publishing their list of favorite links. They call up and say, "we really don't like seeing those numbers in the left column, please take those away." Looking for all the available configuration options, you discover that you can do anything you want on that page except get rid of those pesky numbers!
Template overrides to the rescue!
Every component and module in Joomla has a particular snippet of code called a template, whose job is to generate HTML and nothing else. The Joomla framework is designed to allow templates to replace those snippets as needed. You can build a template that completely takes over the writing of almost all html on the site using these overrides.
These snippets are stored in tmpl folders. If you look in the components and modules folders, you will see a subfolder named for every component and module respectively installed in Jooml. Further down, sooner or later, you will usually see a tmpl folder for that component or module.
Modules are simple and you will generally see a default.php file in there. This is the code snippet generating the HTML for that module.
Components will have a view directory. One more layer down, you will find the different views available for that component. You may notice that these correspond to the different menu items you can create for that component. For example, the contact component has a category and a contact folder in its view directory. And each view has a tmpl folder. And here again you will find all the snippets of code that generate the HTML for that view for that component.
Next: Creating the override in your template.


Subscribe to this site's RSS feed