Thursday, 04 November 2010 19:34

How to Disable Templating While Developing Your Joomla! Extension

Written by 

joomlaDuring the process of developing extensions to Joomla, it can be frustrating to have to wade through a sea of code when you're tweaking the HTML output. Templates can get in the way when all you want to see is your own output before testing integration with templates.

Thankfully, Joomla has two hidden features for development that can make the debugging process a little more bearable. Both these tricks involve passing variables via the URL.

format=raw

The first trick is to add to the end of your URL the variable format=raw to the end of your URL, for example: http://www.your-domain.com/index.php?format=raw will show only the page component, with no HTML header or body tags. Note that if there are other variables already in the URL, use the ampersand (&) rather than the question mark (?).

tmpl=component

This second trick uses the template, but only loads the component position by using tmpl=component. This strips out all modules, such as menus, login boxes, and search boxes. This is useful when testing your HTML formatting for unclosed tags and other HTML errors, by ensuring that you are testing only your own code alongside the template. There's nothing more frustrating when tracking down bugs to spend extra time tracking down errors that turn out to be from someone else's badly coded module.

Leave a comment

A Quote for your Consideration:

"consumers now purchase based on how well those offerings conform to their self-image."

Source: Jim Gilmore and B. Joseph Pine II, from Authenticity: What Consumers Really Want