0
votes

Hello! I've many joomla templates which use component overrides. For some articles, I use the default template, and for others I use other template with "?template=zzz". How can I use other override from template "zzz" than the default from "zzz" override.

Example: I have an article: "Lorem Ipsum", and I want to assign him, the template named "zzz" (!!! "ZZZ" IS NOT THE DEFAULT TEMPLATE of website, and is not assigned to menu !!!), then I put on article url "?template=zzz". Now "Lorem Ipsum" uses the template named "zzz". In "zzz" template folder, I've more overrides for com_content->article (default.php, myskinarticle.php, otherskin.php etc) and I want to use for "Lorem Ipsum" article, the override from ZZZ (which is not the default template, and it isn't assigned to menu), named "otherskin". I think that is like "?template=zzz&override=otherskin".

How can I do this?

1
Hi Teo, your question doesn't make much sense to me. What are you trying to achieve? - seavers
Hi Seavers, I want to use in many articles, a template that's not the default. For that, I use at finally of URl "?template=zzz" and it works. In "zzz" template I have articles overrides (more skins for articles - in: yourdomain.com/templates/zzz/html/com_content/article/default.php - myskin.php - otherskin.php etc) and I want to use the override named myskin, at many article. I have searched on google, but I couldn't find a good response. It may be like (?template=zz&override=myskin) ??? How can I do this (because I want to link to this article with this skin). - Geo

1 Answers

2
votes

I think you need to use the 'layout' parameter:

http://docs.joomla.org/Component_Views_and_Templates

So, your example might be ?template=zzz&layout=otherskin

EDIT:

Another approch would be to create a plugin that switched the content (depending on a parameter in your url) to show the desired template.

Have a look at:

http://docs.joomla.org/Plugin/Events/Content#onBeforeDisplay

This would allow you to hook into the content before display.

You would then be able to access the JFactory::getDocument() method to set the template programatically, using something like:

$doc=&JFactory::getDocument(); 
$doc->setTemplate("my_template_name");

Good luck!