Author Topic: Switching Joomla template on different shopping pages or different users/langs  (Read 23611 times)

silentBob

  • Beginner
  • *
  • Posts: 20
can i use this: MetaTemplate 1.0
to use Template1 for VM-Category-Example1
and
use Template2 for VM-Category-Example2

did i understand it right?

metamodguy

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 49
    • MetaMod and MetaTemplate for Joomla
Hi Bob,

yes, you should be able to do that with a modification of the rules found on http://www.metamodpro.com/support/recipes/36-component-specific/76-control-modules-on-virtuemart-pages

The rules on there are for MetaMod (rather than MetaTemplate), but all you have to do to change them is to change lines like this:

return 101;

to this:

return true;

... then use MetaTemplate in the normal way.

Hope that helps get you started,
Stephen
Regards,
Stephen Brandon
MetaMod and MetaTemplate author

metamodguy

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 49
    • MetaMod and MetaTemplate for Joomla
MetaTemplate 1.2 is now out, which has a built-in fix for the Front-Page Template bug in VirtueMart, mentioned earlier in the thread.

All you have to do to use it is this:
- download MetaTemplate 1.2 from http://www.metamodpro.com/software/metatemplate/download/category/47 and install it
- that's it. The "front page fix" is enabled by default.

If you want to disable the fix, e.g. for testing, you can do the following:
- go to Components->MetaTemplate in the Joomla admin menu
- click on the Parameters icon (top right of window)
- turn the fix on or off with the selector
- click on "save" in the Parameters window.

MetaTemplate also has a new feature that allows you to duplicate any installed template, in 1 click. This makes it easy to make a copy of any template that's already installed, then use that copy (with any modifications you want to make) just for selected pages. More about that on the download page.
Regards,
Stephen Brandon
MetaMod and MetaTemplate author

Eden

  • Beginner
  • *
  • Posts: 14
Sweet with the new version will upgrade now!

Im getting another issue although i think it may be with a third party mod, maybe you can share some light. My site now has a product scroller on it. When clicking on a particular product it always opens in the first template no matter what template your on... weird! Any ideas ?? If you like you can login and take a look (i p'md u a little bit ago)

As with testing shopping seems my client for the moment is only interested in a product catalogue so wont be able to test that til later.

Eden

  • Beginner
  • *
  • Posts: 14
Found a fix for my above post, seems it was once again grabbing the path incorrectly from virtue mart and reverting the default template again... I found a fix though for anyone else that comes across this issue.

Most third party mods will grab paths from the virtuemart paser, when i installed the SEF friendly urls router from http://joomlaplugins.net/joomla-extension-download/cat_view/34-virtuemart-specific-extension.html, and followed the easy instructions, joomla and virtuemart seem to have a better understanding of the correct template to use now :).

Another template issue resolved :) (this fix may be a compliation of all the fixes i have now added all of which can be found in this thread, including one core hack and metatemplate install)

Eden

  • Beginner
  • *
  • Posts: 14
 :o

ok hit yet another snag, product scroller (modified version from here http://forum.virtuemart.net/index.php?topic=57659.msg195029)

This is a very weird anomaly now.

If i goto my landing page, and through to ea energy (the second template in my group of four), the products on the scroller will correctly view in the energy template, if i do to ea-water, view a product, then go back to ea energy again, the links in the scroller have changed now to the ea water template, and products now view in there!

I cannot comprehend how this works ... maybe cookie related somehow ? im not quite sure, maybe you could shed some light on it ?? Weird that it works but if u travel around and come back it breakss again.

scottiedb

  • Beginner
  • *
  • Posts: 5
Can VM Store always return to default template
« Reply #21 on: February 09, 2010, 18:33:40 pm »
I have a Virtuemart store plugged into a Joomla 1.5 site using 3 different templates. I want the ability for the store to ALWAYS return to the default template when viewing any page in the store. Currently, the VM store shows up surrounded by whatever template you were in before you clicked on store related content. It feels like there is an easy way to do this, but I'm just not seeing it. I have MetaTemplate component installed, but I'm not really good with coding, can anyone help? Thanks!

metamodguy

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 49
    • MetaMod and MetaTemplate for Joomla
Well, you can generally achieve this without MetaTemplate. All you would need to do is ensure that there's a menu link to the VM component, then you would assign the desired template to that menu item in Joomla's Template Manager.

The advantage in MetaTemplate, if you want to use it, is that it does not require you to assign VM to a menu item. You can also be more specific about exactly which pages inside VM you want styled.

MetaTemplate Pro: just use the Components selector box on one of the rules, and choose VirtueMart from the box.

MetaTemplate: in the PHP box, use the following rule:

if ($option == "com_virtuemart") return true;
else return false;

For both the Pro and free version, you then do this:
- in the Actions section of the rule, use the drop-down to select the desired template for SUCCESS.

Hope that helps,
Stephen
Regards,
Stephen Brandon
MetaMod and MetaTemplate author

scottiedb

  • Beginner
  • *
  • Posts: 5
Wow. It worked, that is exactly what I was looking for! Thanks Stephen!! I greatly appreciate this!

metamodguy

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 49
    • MetaMod and MetaTemplate for Joomla
Using the standard Joomla Template Manager, or MetaTemplate?
Regards,
Stephen Brandon
MetaMod and MetaTemplate author

scottiedb

  • Beginner
  • *
  • Posts: 5
I used the tidbit line of code you gave me, used it in MetaTemplate, I didn't insert VM in a menu because I have a module that is always on the left side, and I wanted the store module to be seen on every page. So I figured it was useless to have a link to something that everyone can always see. Thanks again!

metamodguy

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 49
    • MetaMod and MetaTemplate for Joomla
Great, glad it worked :)
Regards,
Stephen Brandon
MetaMod and MetaTemplate author

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Excellent way around this J! issue, thanks metamodguy.

gok

  • Beginner
  • *
  • Posts: 11
Hi everyone,

This is a must extension for virtuemart...
But I need something rather easy, I just want to change site background for each category and relevant product pages, What is the best way to achieve this...

Thanks before hand...

Archy

  • Beginner
  • *
  • Posts: 7
Could some post a simple step by step on here as im a novice to PHP.

Posting a link is very nice but how to would it would be even better!!!

How come there isnt a simple way to do this in the component? Maybe they should be looking to this for the next update!!