Skip Template Rendering Topic is solved
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules
Skip Template Rendering
Hi All,
I'm developing a component's page which I don't want to have any template attach to it. But still can be called using
index.php?option=com_component¶m1=value1.....
How can I do that ?
Regards,
Dino
I'm developing a component's page which I don't want to have any template attach to it. But still can be called using
index.php?option=com_component¶m1=value1.....
How can I do that ?
Regards,
Dino
- MMMedia
- Joomla! Enthusiast
- Posts: 233
- Joined: Sun Aug 21, 2005 2:25 pm
- Location: Somewhere Near Here
Re: Skip Template Rendering
Moving this thread to the Coding 101 forum.
Be kinder than necessary, for everyone you meet is fighting some kind of battle.
http://www.oddsheepout.com http://www.jennifermarriott.com
JOOMLA ROCKS
Women JOOMLA! Too
http://www.oddsheepout.com http://www.jennifermarriott.com
JOOMLA ROCKS
Women JOOMLA! Too
Re: Skip Template Rendering
I have found two options:
1. Create a raw view - view.raw.php
This will only render out put from your view but will not load any info in the document head. It's a good option for doing anything with Ajax.
2. Add tmpl=component in the URL query
This will load head info, along with your template css, but will only output your view in the document body. The email a friend icon uses this for the email form pop up window.
Anybody know another/better way to do this?
1. Create a raw view - view.raw.php
This will only render out put from your view but will not load any info in the document head. It's a good option for doing anything with Ajax.
2. Add tmpl=component in the URL query
This will load head info, along with your template css, but will only output your view in the document body. The email a friend icon uses this for the email form pop up window.
Anybody know another/better way to do this?
- lobos
- Joomla! Apprentice
- Posts: 30
- Joined: Wed Jul 19, 2006 3:33 pm
- Location: Sao Paulo, Brasil
- Contact:
Re: Skip Template Rendering
You just need to add exit() or die() after component processing is completed.
for example - mycomponent.php
echo 'helloworld';
die();
?>
Your component will be process within joomla and no templates or modules will be processed or rendered.
-Lobos
for example - mycomponent.php
echo 'helloworld';
die();
?>
Your component will be process within joomla and no templates or modules will be processed or rendered.
-Lobos
Respect and honour, sempre isso, the tribal way, the only way.
http://en.wikipedia.org/wiki/Tribes_Vengeance
http://en.wikipedia.org/wiki/Tribes_Vengeance
Re: Skip Template Rendering
Yes this will keep Joomla from rendering your component output in a template. However the resulting output will not be an actual HTML document either. This will also kill all Joomla processes following the document rendering - caching as well as several other events such as onAfterDispatch and onAfterRender which are used to execute plugins. You also lose the ability to do this variably. I would not recommend this method.
Re: Skip Template Rendering
I was also building a component where I don't need the template to be rendered always. In the view where I don't need it, I don't call the "parent::display($tpl);" function your supposed to call. Does this keep my template from being rendered?
Re: Skip Template Rendering
parent::display($tpl) loads the template of your view not the template of your site. If you do not call that display function anywhere in your view Joomla will not render any output from your component but it will still load the template of your site.
Re: Skip Template Rendering
i see... my code is a couple short lines though: I get what I need from the model and then I just print it out:
so, the only way to just render this without wasting time and energy would be to call the 'view' file view.raw.php?
Code: Select all
$xml = $this->get( 'XML' );
$page = & JFactory::getDocument();
$page->setMimeEncoding( 'text/xml' );
JResponse::setHeader( 'Content-Disposition', 'inline; filename=xml.xml' );
echo $xml;
so, the only way to just render this without wasting time and energy would be to call the 'view' file view.raw.php?
Re: Skip Template Rendering
Not the only way but yes I would recommend using the raw format in your case. You only need two things.
1. In the URL linking to this, add "format=raw" as a variable in the URL query
2. Save this view file as view.raw.php
That's it.
1. In the URL linking to this, add "format=raw" as a variable in the URL query
2. Save this view file as view.raw.php
That's it.