VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: koumei on December 21, 2011, 14:56:33 PM

Title: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: koumei on December 21, 2011, 14:56:33 PM
In Extensions - Module Manager I can add featured products module ok.

But I would like to set the template featured products. How can I override the featured products template? Anyone can help?
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: PRO on December 21, 2011, 16:19:32 PM
the module or the featured products on homepage?
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: koumei on December 22, 2011, 01:32:33 AM
Quote from: BanquetTables.pro on December 21, 2011, 16:19:32 PM
the module or the featured products on homepage?

It is featured products on home page, i want to change its template.
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: JtouchMobile.com on December 22, 2011, 03:03:32 AM
/components/com_virtuemart/views/virtuemart/tmpl is the folder you would like to take a look in ;)
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: koumei on December 22, 2011, 04:17:41 AM
Quote from: MobileMeWs on December 22, 2011, 03:03:32 AM
/components/com_virtuemart/views/virtuemart/tmpl is the folder you would like to take a look in ;)

You are right. My concern of this if I modify the code in here, next time VM2 update would probably override my changes...
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: koumei on December 22, 2011, 07:00:31 AM
I understand i can override the template of that folder, but if i override it, the home page featured product template is changed and also all the product list changed. in this case, i just want to change the template of home page featured product.
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: PRO on December 22, 2011, 10:36:48 AM
do a template override
http://forum.virtuemart.net/index.php?topic=90935.0

NOT modify the file
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: koumei on December 22, 2011, 13:39:03 PM
Quote from: BanquetTables.pro on December 22, 2011, 10:36:48 AM
do a template override
http://forum.virtuemart.net/index.php?topic=90935.0

NOT modify the file

Maybe I did not ask my question clearly.

The template of Home Featured Product and Product List template they are the same, correct? So If I override the template in /mytemplate/html/mod_virtuemart_product/default.php, both home featured product style and product list style are changed. My question is how to have different template for home featured product and product list?
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: PRO on December 22, 2011, 14:33:47 PM
use 2 different module, and you can do a moduleclass suffix

or create 2 views
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: koumei on December 22, 2011, 15:38:12 PM
Quote from: BanquetTables.pro on December 22, 2011, 14:33:47 PM
use 2 different module, and you can do a moduleclass suffix

or create 2 views

thanks for you replies :-P I believe it is very helpful!~

moduleclass suffix does not work for me, because i am not only use style sheet.

How do you mean create 2 views? Thanks.
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: PRO on December 22, 2011, 16:11:18 PM
the the module/tmpl

you can copy default.php

and rename it to  modified.php

THEN, in the module settings there is a dropdown for layout.
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: koumei on December 23, 2011, 15:07:07 PM
Quote from: BanquetTables.pro on December 22, 2011, 16:11:18 PM
the the module/tmpl

you can copy default.php

and rename it to  modified.php

THEN, in the module settings there is a dropdown for layout.

Module type "Virtuemart Products" does not have dropdown list for the layout.
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: PRO on December 23, 2011, 15:34:51 PM
What I do IN MY JOOMA template is have specific module position for category, and productdetails view


SO, this code below creates a module position for the default virtuemart view


<?php if (JRequest::getVar('view')=='virtuemart') { ?>
<div id="positiondiv"><jdoc:include type="modules" name="modulename" /></div>
<?php } ?>


Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: koumei on December 25, 2011, 13:37:42 PM
Quote from: BanquetTables.pro on December 23, 2011, 15:34:51 PM
What I do IN MY JOOMA template is have specific module position for category, and productdetails view


SO, this code below creates a module position for the default virtuemart view


<?php if (JRequest::getVar('view')=='virtuemart') { ?>
<div id="positiondiv"><jdoc:include type="modules" name="modulename" /></div>
<?php } ?>

Thank you very much for the solution. Merry Christmas!!
Title: Re: VM2.0.0 - Can I set template for featured products (or override the template)?
Post by: PRO on December 25, 2011, 17:22:40 PM
Quote from: koumei on December 25, 2011, 13:37:42 PM

Thank you very much for the solution. Merry Christmas!!

Here is a little more info
http://www.kaizenmediaworks.com/virtuemart-template-and-module-control