Joomla component: exit without html

I am developing a Joomla component for Joomla 2.5. Since it should output XML, I most strongly do not want to display the surrounding template.

I tried to add the url:

  • ? TMPL = component
  • ? = Raw format
  • ? TMPL = raw

But the first will generate some HTML around the output of the content, and the second gives me a 500 error. The third does not generate any output. I assume that he is looking for a template called "raw" because any other tattoo template name that I put there gives me the same result.

How can I output XML from my component without any additional Joomla + HTML template?

+6
source share
1 answer

In Joomla! 1.5 all you had to do was add ?tmpl=component&format=raw , but to achieve raw rendering

In Joomla! 2.5 you need to make a view.raw.php file that can be identical to the existing view.html.php , but it depends on your needs. And also in the controller, you must manually create the original view, because the default type is html.

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

+9
source

Source: https://habr.com/ru/post/916570/


All Articles