News:

Support the VirtueMart project and become a member

Main Menu

Different Sublayouts for different product categories?

Started by tkejmullins, June 29, 2015, 22:56:58 PM

Previous topic - Next topic

tkejmullins

I have looked for several hours, including http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html.  I can not find a simple explanation as to how I would use a sublayout for 1 product category, but use a different sublayout for a different product category.  The  only setting I see is for the entire store in the configuration.  I use template overrides, but I need to also customize the products.php sublayout for different product categories.

VM 3.0.9.4
Joomla 3.4.1

Any help would be greatly appreciated.

GJC Web Design

the way I do it  - no idea if the right way..  is make my sublayout  in templates\xxxx\html\com_virtuemart\sublayouts\products-mylayout.php

then a cat over ride in templates\xxxx\html\com_virtuemart\category\default-mylayout.php

in there call

echo shopFunctionsF::renderVmSubLayout('products-mylayout',array('products'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));


and then in the cat admin choose the template default-mylayout
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum