Joomla component: Output without html

joomla, joomla-extensions

Solution

In Joomla! 1.5 all you had to do is add `?tmpl=component&format=raw` but to achieve raw display

In Joomla! 2.5 you need to make view.raw.php file which can be identical to your existing `view.html.php`, but that depends on your needs. And also in the controller you have to manually instantiate raw view because default type is html.

A very good example you can find in file `administrator/components/com_banners/controllers/tracks.raw.php` which is the part of default components shipped with Joomla.

Problem

I am developing a Joomla component for Joomla 2.5. Since it's supposed to output XML, I most defenitely don't want to display the surrounding template. I have tried appending to the url: - ?tmpl=component - ?format=raw - ?tmpl=raw But the first will generate some HTML around the content output and the second gives me a 500 error. The third one generates no output at all. I assume it's looking for a template named "raw", because any other gibberish template name I put there gives me the same result. How can I output XML from my component without any of the additional Joomla + template HTML?

Original source