News:

Support the VirtueMart project and become a member

Main Menu

sublayouts

Started by tophatco, August 07, 2014, 16:16:16 PM

Previous topic - Next topic

tophatco

Hi All,

Experimenting with 2.9.8 I noticed the template system has changed quite a bit.  I was wanting to create a second Category Template where the child categories were displayed differently.  I can create a new template in the /views/category/tmpl folder but the display of the child categories is handled by the new sublayouts/categories.php.

So basically I am looking to have different versions of the categories.php but I am not sure if this is really an option.

Any ideas?

GJC Web Design

Quotecreate a new template in the /views/category/tmpl folder

would be preferable in templates/YOUR_TEMPLATE/html/com_virtuemart/category

you can also over-ride the sublayouts in

templates/YOUR_TEMPLATE/html/com_virtuemart/sublayouts

the sublayouts are called by

echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children));

so you could try

echo ShopFunctionsF::renderVmSubLayout('categories2',array('categories'=>$this->category->children));

and make a categories2.php in templates/YOUR_TEMPLATE/html/com_virtuemart/sublayouts
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

tophatco

Quote from: GJC Web Design on August 07, 2014, 16:50:22 PM
Quotecreate a new template in the /views/category/tmpl folder

would be preferable in templates/YOUR_TEMPLATE/html/com_virtuemart/category


Yes, generally I do this once everything is finalized.

Quote from: GJC Web Design on August 07, 2014, 16:50:22 PM

the sublayouts are called by

echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children));

so you could try

echo ShopFunctionsF::renderVmSubLayout('categories2',array('categories'=>$this->category->children));

and make a categories2.php in templates/YOUR_TEMPLATE/html/com_virtuemart/sublayouts

I tried this and it works! Thanks!

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/