Can't choose different layout for category

  • Posts: 127
  • Thank you received: 8
9 years 6 months ago #232967

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5.12

Hi.

I followed the instrcutions here www.hikashop.com/support/documentation/1...-display.html#layout and created a new view called listing_div_homepage (renaming the listing_div view).

Problem is, I can't find where I set the div_listing_homepage to override the default settings as I look at the Hikashop options originally on the module where I wanted to change it and then also on a menu item with type of 'category listing'. Could you pleas show me where I can activate my custom view to override the default view.

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 84307
  • Thank you received: 13701
  • MODERATOR
9 years 6 months ago #232999

Hi,

The listing_div, listing_table and listing_list view files cannot be switched to other view files.
What is described there only works for the product box layouts like listing_img_title, listing_img or listing_title, etc
If you want to display differently the listing_div view file for different categories, you'll have to do it yourself in the code of the listing_div view file.
Something like that at the beginning:
<?php if($this->element->category_id == XXX){
include_once(PATH_TO_LISTING_DIV_HOMEPAGE);
return;
} ?>

Please Log in or Create an account to join the conversation.

  • Posts: 127
  • Thank you received: 8
9 years 6 months ago #233034

Alright then thanks for the reply.

Please Log in or Create an account to join the conversation.

  • Posts: 127
  • Thank you received: 8
9 years 6 months ago #233152

Actually another question regarding the original post, how would I target the content module if I was displaying all the categories.

So I want to display all my categories on the homepage with the content module how would I create a file to override the default file?

Please Log in or Create an account to join the conversation.

  • Posts: 84307
  • Thank you received: 13701
  • MODERATOR
9 years 6 months ago #233165

Hi,

YOu can use the same method, but this time you can base yourself on the category_id and the fact that you're in a module:
<?php if($this->element->category_id == XXX && $this->module){
include_once(PATH_TO_LISTING_DIV_HOMEPAGE);
return;
} ?>

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum