I am building a Facebook canvas app, and the code suppose to be generated in Joomla component. I need to only output the content , excluding the default layout. any ideas?
Asked
Active
Viewed 1,895 times
2
-
Well I want component to display just a the content when refered via url, usually site uses template which has widgets right? and it displays those widgets along with content that is generated in component – simple Apr 10 '10 at 09:41
-
I know that I can add menu item and set to this manu item some empty layout and point it to the component I need - but I don't need this menu item to show up, Of course I we can make this menuItem hidden through tricks, but it is just wrong(I know that 90% of joomla is all wrong but still adding tricks and wrong things will lead to mess). As I suppose if Joomla makes good use of hooks, then it should be possible to switch layout somewhere in plugin depending weather the URL is looking for - "myFacebookCanvasComponent", any thoughts ? – simple Apr 10 '10 at 09:47
-
of course better would be disable layout, instead of switching to empty one =) – simple Apr 10 '10 at 09:48
-
anybody? or will have to look at Joomla Code (it is usually the best way but takes time) – simple Apr 11 '10 at 09:19
-
I suppose that here people don't really tolerate the Joomla =), well after looking at the architecture and code I also think it is bad. But sometimes we have to do what we have to do, can't tell the client to switch some other things – simple Apr 13 '10 at 11:27
2 Answers
9
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”.
JRequest::setVar('tmpl', 'component');
To learn more,See this.

Ian Hunter
- 9,466
- 12
- 61
- 77

Saeid
- 580
- 7
- 8
2
You can create a view called view.facebook.php (instead of view.html.php), it will be called when index2.php?.....&view=facebook will be attached to URL.
or you can call die() just after you execute your code, but do I need to explain that it's not ellegant?

GDR
- 2,301
- 1
- 21
- 26