VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: tophatco on August 07, 2014, 16:16:16 PM

Title: sublayouts
Post by: tophatco on August 07, 2014, 16:16:16 PM
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?
Title: Re: sublayouts
Post by: 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

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
Title: Re: sublayouts
Post by: tophatco on August 07, 2014, 16:57:15 PM
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!
Title: Re: sublayouts
Post by: Milbo on August 08, 2014, 08:10:11 AM
Your changes of the sublayout sound like the layout included here
http://extensions.virtuemart.net/support/virtuemart-supporter-membership-detail