Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » Using two templates for virtuemart
Using two templates for virtuemart
Using two templates for virtuemart
Hi, I've been trawling the forum for an hour or so and cant find the answer to my question.
I'm using Joomla! 1.5 and The latest edition of Virtuemart.
I dont know much php but would love to get this issue sorted asap.
I've written two templates for my eCommerce Shop and the both work individually.
"Template 1" I would like to show on the homepage of the website as it has a JavaScript image slider, now... for the rest of the virtuemart site ie browspage/flypage/checkout etc I would like to show "Template 2" without the Javascript Image Slider.
Does anyone have any recipes that they would be willing to share.
I'm using the free edition of the MetaTemplate Component.
Any help would be greatly appreciated.
G
11-Jul-11 15:46:08
Re: Using two templates for virtuemart
Hi gman2712,
this is going to be easy - it's exactly what MetaTemplate is designed to do. The only thing I need to check from you is what kind of page is the front page of your site? Is it a Virtuemart menu item (kind of a VM front page), or is it a standard Joomla frontpage view, or an article etc? If you can take a look at the menu manager and identify exactly what type of page it is, I'll write you some code to do what you're asking for above.
Cheers,
Stephen
Re: Using two templates for virtuemart
Thanks Stephen
I think it runs straight off the Joomla Homepage, basically I set home in the "main menu" of joomla to the component of virtuemart.
If you wish to go and have a look for yourself you're more than welcome.
www.shop.27twelve.com
I am new to both joomla and virtuemart so I get a bit confused as to what exactly is happening.
I am very grateful for your help.
Graeme
Re: Using two templates for virtuemart
So just so explain clearly its running "template1" once you arrive oon the site, after you click into one of the categories listed underneath the slider on the homepage I would like the second template to run, basically i've just duplicated it and removed the slider code.
Regards
Graeme
Re: Using two templates for virtuemart
Hi Graeme,
Here's how to get template1 ONLY on the front page, and template2 everywhere else.
1 - set the default template to template2 (the one for the "rest of the site")
2 - make a new MetaTemplate rule.
3 - use the following PHP in the main PHP box on the left:
$vm = JomGenius("virtuemart");
if ($vm->check("pagetype = frontpage")) return true;
4 - in the SUCCEED action, use the dropdown to select template1
5 - save the rule
That should do it :-)
In this way, the rule detects if you are on the standard VM frontpage, and returns "true" (makes the rule succeed). Then the succeed action runs, which sets the template. If the rule fails, then nothing happens and the default template is used.
Cheers,
Stephen
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » Using two templates for virtuemart
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5946
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 7675
- Newest User:
- ferelya229
- Members Online:
- 0
- Guests Online:
- 169
- 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