Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » MetaTemplate
MetaTemplate
MetaTemplate
So it seems to be a very usefull tool (I'm talking about MetaTemplate ), but only if you can use it properly.I'm not because i haven't found any information on this site nor API documentation excluding few videos which concern MetaTemplatePro.
My simple question is: Is it possible if i have for instance two templates A and B to load one of them by the user's choice at the begining when the site loads using javascript window prompt or anithing else.
Thanks in advance
Re: MetaTemplate
Hi eboyanov,
well, there is now documentation (from yesterday) on how to set up the MetaTemplate rules - but that's not going to help with your particular request.
MetaTemplate doesn't include any end-user interface elements. It doesn't include a module for the user to choose one of the installed templates, for example.
MetaTemplate *can* be used as the back-end for such a system though. So if you make a Javascript popup display that lists some templates, you could make hyperlinks from those images, back into your site. These hyperlinks could have "?template=XXXXX". Then MetaTemplate can pick up these URL parameters and use them to drive the rest of the session.
However, what you're asking for is actually very close to the functionality provided by modules such as Template Chooser, except that it appears in a module rather than as a Javascript popup. Perhaps you could take the source of Template Chooser and modify it to display in a popup rather than a module?
Hope that helps,
Stephen
Re: MetaTemplate
Thank you very much for your rapid answer Stephen,
metamodguy wrote:
MetaTemplate *can* be used as the back-end for such a system though. So if you make a Javascript popup display that lists some templates, you could make hyperlinks from those images, back into your site. These hyperlinks could have "?template=XXXXX". Then MetaTemplate can pick up these URL parameters and use them to drive the rest of the session.
that is the think i need and i understood it before putting my first post here.The only think i can't
understand which variable holds these URL parameters.Should i assign my own or there is an array or somethig like an instance of object that keeps such things.There is a block with help info about few variables that we can acces on the page for rules configuration, but i was not able to find somethig related to my problem.
Best regards and
Thank you
Re: MetaTemplate
Hi eboyanov,
in MetaTemplate Pro there's a text box that allows you to do substring searches of the URL, so you can check, for example, if the URL "ends with" "template=XXXXXX".
Alternatively, in the PHP box you can use the JRequest object, which picks up any URL parameter by name.
e.g.
$requested_template = JRequest::getVar("template");
if ($requested_template == "XXXXXX") return true;
If you do that, then the rule SUCCEEDS and you can set the template in the SUCCEED action, plus set a session variable etc to remember the decision for the future.
That's just a very simple example. There are a number of ways you can approach this, but I wanted to demonstrate using JRequest to get hold of URL parameters.
Best regards,
Stephen
Re: MetaTemplate
Thank you Stephen,
but i think that i am a great idiot because it does not work for my case.
More accurately it works but only partly.At the begining when you load the page with the desired template in the URL "http://somehost.com/?template="XXXXXX"" it works perfectly as I expect, but when i try to follow the links in site template switches to another one which correspond to the clause in the rule that return false.
That is
B.R.
Evgeni
Re: MetaTemplate
Hi Evgeni,
Please watch this YouTube video to find out how to make the selection "sticky" for the rest of the user's session:
http://www.youtube.com/watch?v=ku8q9rJQGR8
Best regards,
Stephen
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » MetaTemplate
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Total Posts Today:
- 1
- User Info:
- Total Users:
- 7638
- Newest User:
- moner86658
- Members Online:
- 0
- Guests Online:
- 148
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked