How to display the image of only the current category

  • Posts: 2
  • Thank you received: 0
7 years 8 months ago #278051

I have created a system of 3 first level categories with their respective second level subcategories. So for example I have a first level category with 10 second level sub categories. Each category/subcategory has an image and a title. What I am trying to do is have the user select one of the 3 first level categories, which will take him to a list of the second level categories. And from there to select one of the second level ones to be taken to the list of products.

My problem is that I do not want the image of the parent category to show only on the second level category listing, but to show on the product listing after the user selects the second level subcategory (confusing I know).
I have tried to deactivate the "display image" option from the menu Hikashop category listing tab, but it affects the third level category listing.

In the First image the red arrow shows the first level category image on the page with the second level category listing below (blue arrows), in case that helps.



In the second image its the second level category list of products with the arrow pointing at the parent category (second level category)



Any ideas?

Attachments:

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

  • Posts: 83798
  • Thank you received: 13570
  • MODERATOR
7 years 8 months ago #278070

Hi,

There is only an option for all the listing pages of the menu item.
So the behavior you're describing is normal.
There is no option to do what you want.
So several possibilities:
1. You can keep that option activated, and then hide the image on the pages you don't want it with CSS. If you look at the main divs of the listing with your web inspector, you'll see that each page has a class specific to that page englobing it.
So you can prefix the class of the image with that class in order to remove the image on that page specifically with a display:none; CSS rule.

2. You can configure a second menu item that you will have in a menu group that isn't displayed normally on your frontend, like the "hikashop default menus". And then, use the canonical URL of your categories to change the menu item alias in the URL of the categories to the hidden menu item thanks to the "force canonical URL on listing" setting of the HikaShop configuration.
That way, you now have two menu items. One for the categories for which you don't want the image to display at the top when you click on them, and one for which you want it to display.

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

  • Posts: 2
  • Thank you received: 0
7 years 8 months ago #278193

Ok I tried the first option but apparently the page class I added from the menu was also in the product listing of the subcategory and thus did not display the category image in the product listing where I want it to show.

For the second suggestion I set the force url canonical Use canonical and generate it if missing, but then I am not sure what you mean for me to do. Also when you say "configure a second menu item" you mean a copy of the category which I want to have specific settings?

Thank you for the help by the way.

Attachments:

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

  • Posts: 83798
  • Thank you received: 13570
  • MODERATOR
7 years 8 months ago #278217

Hi,

We would need a link to the pages you're talking about to be able to give more precise instructions.

When I say "configure a second menu item", I mean going to the Joomla menu manager, clicking on the "new" button, select HikaShop categories listing and configure it similarily to the one you already have but in a menu that isn't visible and with the show image option turned off.
Then, change alias of the menu item from one to the other int he canonical URL to switch between the two menu items and thus between the display of the category or not.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum