Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

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

Edited By: gman2712
11-Jul-11 14:46:08

gman2712
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

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.

http://dl.dropbox.com/u/1858963/Screen%20Shot%202011-07-12%20at%2014.17.50.png

I am very grateful for your help.

Graeme

gman2712
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

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

gman2712
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Using two templates for virtuemart

Worked like a treat, thank you very much.

Great Component

Great Functionality.

Cheers

Graeme

gman2712
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5914
Total Posts Today:
1
User Info:
 
Total Users:
10815
Newest User:
eric10001
Members Online:
1
Guests Online:
220

Online: 
eric10001

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked