Remove template from 1 page inside a component

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Forum rules
Post Reply
bartboy
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Aug 25, 2007 3:38 pm

Remove template from 1 page inside a component

Post by bartboy » Thu Jan 31, 2008 1:49 am

Hi there,
I'm bumping my head against a brick wall  :'(
I have amended a component using existing functions and have generated the desired output. The only issue is that this output is displayed inside my site's template whereas I would like to show it in a blank page. Due to all the php involved, I don't think I can take it out of the component, so has anyone an idea on how to do this?

Say I have a component called "test" with tons of functions and working fine. I amended "test.php" inside this component to have it produce a html output based on special parameters sent in a special situation. In this special case, the output would need to be excluded from the site's template, but normally for this component it should include the template.

Hope a genius can shed some light on how to do this.

Many many many thanks!!! ;)

Bart ;)

User avatar
ianmac
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 237
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Remove template from 1 page inside a component

Post by ianmac » Thu Jan 31, 2008 4:41 am

Sure that is easy...

Try adding &tmpl=component on to the end of your query string.  This is the solution if you want only the component to show, but you want it wrapped in HTML.

Or, add &format=raw, if you want only the output from your component.  If you do this, and you are using MVC, you have to create a view.raw.php to support it.

Ian
Help test my Component XML Generator Tool!
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,1997/Itemid,35/
All feedback appreciated!

bartboy
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Aug 25, 2007 3:38 pm

Re: Remove template from 1 page inside a component

Post by bartboy » Thu Jan 31, 2008 10:25 am

Thanks Ian, much appreciated.
As a newbie, I forgot to mention that I am on Joomla! 1.0.13 not 1.5. So not sure if MVC is there.
I tried with &tmpl=component or/and &type=raw but nothing changes. What else do I need to do?
I tried to look these up on the web, but can't find much info on them.

My component is working like a charm as is, I just want to remove the template of my joomla site from the output of this component when using a parameter sent in the url. Your suggestion would seem perfect for that, but I seem to be missing something to make it work.

Many Thanks.

Bart


OK sorted! I used index2.php and I added  "&no_html=1" at the end of the url.
You can find more info here:
http://forum.joomla.org/index.php/topic,108871.0.html
Last edited by bartboy on Fri Feb 01, 2008 12:50 am, edited 1 time in total.


Post Reply