- Posts: 62
- Thank you received: 0
Category 'listing.php' Question
11 years 1 month ago #212699
by ninjab
Category 'listing.php' Question was created by ninjab
-- HikaShop version -- : 2.5.0
Hi there, I want to be able to choose specific listing.php for different categories. Is there a way to do this? Because I am wanting tot display a menu on some categories but not on its parent, and since I am no creating menu items for them I cannot set the menu up to only display on those categories.
And I need the menu to be within the category description.
I know I could just add a HTML shortcode in the category html description to add the menu module in the categories I need them but I'd rather do it another way if possible so I don't have to put it in every time.
Thanks.
Hi there, I want to be able to choose specific listing.php for different categories. Is there a way to do this? Because I am wanting tot display a menu on some categories but not on its parent, and since I am no creating menu items for them I cannot set the menu up to only display on those categories.
And I need the menu to be within the category description.
I know I could just add a HTML shortcode in the category html description to add the menu module in the categories I need them but I'd rather do it another way if possible so I don't have to put it in every time.
Thanks.
Please Log in or Create an account to join the conversation.
11 years 1 month ago #212719
by ninjab
I found another post by someone else and I managed to achieve what I wanted with one category, but how do I add/edit the PHP to add more category numbers in that code above without having to duplicate it 20-30 times?
For instance to be able to do ==36, 37, 38 etc
Thanks
Replied by ninjab on topic Category 'listing.php' Question
Code:
<? if($this->element->category_id==36): ?>
<? else: ?>
<div id="prod-menu-cat">
<? echo JHTML::_('content.prepare','{module Maximenu CK (4)}'); ?>
</div>
<? endif; ?>
I found another post by someone else and I managed to achieve what I wanted with one category, but how do I add/edit the PHP to add more category numbers in that code above without having to duplicate it 20-30 times?
For instance to be able to do ==36, 37, 38 etc
Thanks
Please Log in or Create an account to join the conversation.
11 years 1 month ago #212722
by ninjab
Replied by ninjab on topic Category 'listing.php' Question
After googling PHP coding of something similar, I worked out that it would be like this for adding multiple cat IDs:
<? if($this->element->category_id==36 || $this->element->category_id==43):
<? if($this->element->category_id==36 || $this->element->category_id==43):
Please Log in or Create an account to join the conversation.
11 years 1 month ago #212720
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Category 'listing.php' Question
Hi,
Regards,
Code:
<?php if(in_array($this->element->category_id, array(XXX, YYY, ZZZ))) { ?>
<?php } else { ?>
<?php } ?>
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.151 seconds