Joomla!: How to hide the Administrator or Front end layout template

April 21st, 2009 by rvdavid Leave a reply »

It’s taken a good part of an hour trying to find how to disable the administrator or front end template for Joomla.
So I thought I’d just make a post in an effort to turn this frustrated energy into something positive.

To display only the contents of the view on the page without being framed by a template, the tmpl variable needs to be set to “component”.

Something along the lines of having the following snippet in the controller method:
JRequest::setVar(‘tmpl’, ‘component’);

Either that, or adding “&tmpl=component” to the URL.

I remember doing it before, however it’s been a while.

All attempts at searching on how to do the above proved frustratingly impossible as the organic search results for google are filled with people asking how to “disable legacy” modes, “templates”, “modules”, “plugins”, how to make your joomla admin panel rock(!!!!) – not what I was looking for!

Anyway, it’s a rather simple, but not particulary obvious thing – I had to track down the code which I had written over 6 months ago to track that snippet down.

Hope this helps other Joomla! component developers :P

Advertisement

6 comments

  1. CyberOrca says:

    I have a few trick that maybe help you to complete this article and also very helpfull for the other webmaster or even newbie that want to learn Joomla!. E-Mail me, and i’ll respon…^_^

  2. peter says:

    THANXXXX!!!!
    I testet the last three hours to find exactly your solution. I searched at google, i searched at various joomla pages, didn’t find anything. AND THEN I FOUND YOUR BLOG. GREAT
    One sentence with exact infos.
    Why is it so difficult for the joomla core members to write a complete documentation. The documents for joomla are absolut horrible.
    My knowledge of joomla isn’t enough to do so

  3. John R. says:

    “&tmpl=component” does not work well with SEF.

    I suggest using “JRequest::setVar(’tmpl’, ‘component’);” instead.

  4. rvdavid says:

    peter – glad it heled you out mate, I was in exactly the same position as you were, but couldn’t find anything. I can’t remember how I did it the first time – anyway, glad it helped.

    John R. – how does using query strings not work well with SEF?

Leave a Reply