[Skip to main content](#vessel-content)

#   Handling different category templates.

##

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 11 months ago [\#3018](#3018) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  *[Handling different category templates.](/forum/4-how-to/3018-handling-different-category-templates#3018 "I have a Joomla menu item called 'shop' which displays a list of categories. I have selected image + title display - so it uses template: listing&#95;img&#95;title.php However, I only want the image displayed on some of the categories. Or to put it another way I want to use different templates down the tree, like this:  &#42; Category 1 - template 1 (e.g. listing&#95;title.php)  &#42; Category 1.1 - template 1  &#42; Category 1.2 - template 1  &#42; Category 1.2.1 - template 2 (e.g. listing&#95;img&#95;title.php)  &#42; Category 1.2.2 - template 2  &#42; Category 2 - template 1  &#42; Category 3 - template 1  How can I do this?")* was created by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")*

I have a Joomla menu item called 'shop' which displays a list of categories.
I have selected image + title display - so it uses template: listing_img_title.php
However, I only want the image displayed on some of the categories.
Or to put it another way I want to use different templates down the tree, like this:

- Category 1 - template 1 (e.g. listing\_title.php)

- Category 1.1 - template 1
- Category 1.2 - template 1

- Category 1.2.1 - template 2 (e.g. listing\_img\_title.php)
- Category 1.2.2 - template 2

8. Category 2 - template 1

9. Category 3 - template 1

How can I do this?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTgtaGFuZGxpbmctZGlmZmVyZW50LWNhdGVnb3J5LXRlbXBsYXRlcz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 11 months ago [\#3020](#3020) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Handling different category templates.](/forum/4-how-to/3018-handling-different-category-templates#3020 "I have a Joomla menu item called 'shop' which displays a list of categories. I have selected image + title display - so it uses template: listing&#95;img&#95;title.php However, I only want the image displayed on some of the categories. Or to put it another way I want to use different templates down the tree, like this:  &#42; Category 1 - template 1 (e.g. listing&#95;title.php)  &#42; Category 1.1 - template 1  &#42; Category 1.2 - template 1  &#42; Category 1.2.1 - template 2 (e.g. listing&#95;img&#95;title.php)  &#42; Category 1.2.2 - template 2  &#42; Category 2 - template 1  &#42; Category 3 - template 1  How can I do this?")*

I see what you want to do. But then, one could ask to have such possibilities for other options of the menus/modules. In order to accomplish such feature, I think we should add an "menu" override option to each category and that would override the current menu itemid in the links so that when you select the category, the itemid would be changed in the URL and, thus, the options affected to the view would be changed.
It seems like a nice way of handling all that.

Now, if you want a solution right away, you should edit the file listing_div of the view category in the menu Display-&gt;Views and set the item view type dynamically based on the categories: Code:

if(in_array($this-&gt;element-&gt;category_id, array(2,8,16))){ $this-&gt;params-&gt;set('div_item_layout_type','img_title'); }

So, for the categories with the id 2, 8 and 16, the item layout type would be overriden to the img_title template instead of the one in the options of the menu.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTgtaGFuZGxpbmctZGlmZmVyZW50LWNhdGVnb3J5LXRlbXBsYXRlcz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 11 months ago [\#3033](#3033) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: Handling different category templates.](/forum/4-how-to/3018-handling-different-category-templates#3033 "I have a Joomla menu item called 'shop' which displays a list of categories. I have selected image + title display - so it uses template: listing&#95;img&#95;title.php However, I only want the image displayed on some of the categories. Or to put it another way I want to use different templates down the tree, like this:  &#42; Category 1 - template 1 (e.g. listing&#95;title.php)  &#42; Category 1.1 - template 1  &#42; Category 1.2 - template 1  &#42; Category 1.2.1 - template 2 (e.g. listing&#95;img&#95;title.php)  &#42; Category 1.2.2 - template 2  &#42; Category 2 - template 1  &#42; Category 3 - template 1  How can I do this?")*

Thanks for that - changing the template as you suggested did what I wanted.

An override feature sounds like the way to go.

1. Override for category.
Inheritance handling - Sub-categories inherit override or default?

2. Override for product at category level.
Inheritance handling?

3. Override for product.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTgtaGFuZGxpbmctZGlmZmVyZW50LWNhdGVnb3J5LXRlbXBsYXRlcz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 11 months ago [\#3034](#3034) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Handling different category templates.](/forum/4-how-to/3018-handling-different-category-templates#3034 "I have a Joomla menu item called 'shop' which displays a list of categories. I have selected image + title display - so it uses template: listing&#95;img&#95;title.php However, I only want the image displayed on some of the categories. Or to put it another way I want to use different templates down the tree, like this:  &#42; Category 1 - template 1 (e.g. listing&#95;title.php)  &#42; Category 1.1 - template 1  &#42; Category 1.2 - template 1  &#42; Category 1.2.1 - template 2 (e.g. listing&#95;img&#95;title.php)  &#42; Category 1.2.2 - template 2  &#42; Category 2 - template 1  &#42; Category 3 - template 1  How can I do this?")*

Thank you for your input.
Everything you said is possible.... We just need to get to it and take some time to do it ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTgtaGFuZGxpbmctZGlmZmVyZW50LWNhdGVnb3J5LXRlbXBsYXRlcz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.058 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
