VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: whoami on December 11, 2011, 22:08:15 PM

Title: How does Category override work?
Post by: whoami on December 11, 2011, 22:08:15 PM
Maybe I'm doing something wrong. I've created a category override in my template HTML dir with a different name then default.php. It's called lesson.php

template_dir/html/com_virtuemart/productdetails/lessons.php

In the config of Virtuemart I've selected in the template area "no override" for the product template. In the Category I've selected "lesson.php" as override. Doesn't work. When I select default.php as override it works for the change default.php. Everything else with a different name then default.php do not work.

What I'm doing wrong?
Title: Re: How does Category override work?
Post by: JtouchMobile.com on December 12, 2011, 06:10:27 AM
You are doing a template overwrite, so why not make it easy by changing the lessons.php to default.php ?

(template_dir/html/com_virtuemart/productdetails/default.php)
Title: Re: How does Category override work?
Post by: whoami on December 12, 2011, 08:59:03 AM
I need two different layouts for different productcategories.

BTW, why have an option choosing your layout when this option doesn't work?
Title: Re: How does Category override work?
Post by: JtouchMobile.com on December 13, 2011, 03:49:00 AM
It works with my RC2 J (K now :( )
Here is what I have done:
- From components/com_virtuemart/views/category/tmpl
creata a copy of default.php -> extra.php
modify extra.php to what I want to

- From backend -> Products menu ->Product Categories
edit the category I want to apply this extra template
set "extra" for "Category Browse Page" -> save it (see my screenshot)

- Browse the category on frontend, attached file is what I'm seeing


[attachment cleanup by admin]
Title: Re: How does Category override work?
Post by: whoami on December 13, 2011, 10:08:13 AM
@MobileMeWs: Thanks I've tried the category override and it did work BUT try the same with a productdetail override (that is what I initialty ment, my wrong). The productdetail override doesn't work.
Title: Re: How does Category override work?
Post by: carlos.alonso on January 04, 2012, 18:59:38 PM
Hi,

I was having the same problem, then i realized i had an Uppercase letter in the name of the view, i changed to lower case and now i can override without any problem.

It was silly of me but this was my problem, hope it is useful.