Author Topic: sublayouts  (Read 8398 times)

tophatco

  • Beginner
  • *
  • Posts: 46
sublayouts
« 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?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10743
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: sublayouts
« Reply #1 on: August 07, 2014, 16:50:22 pm »
Quote
create 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
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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

  • Beginner
  • *
  • Posts: 46
Re: sublayouts
« Reply #2 on: August 07, 2014, 16:57:15 pm »
Quote
create 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.


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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10545
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: sublayouts
« Reply #3 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
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/