Add a class for the product listing page only

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
3 years 11 hours ago #340106

-- HikaShop version -- : 4.5.0
-- Joomla version -- : 4.1.0
-- PHP version -- : 7.4.27
-- Browser(s) name and version -- : Firefox Developer 99.0b3

Hello,

I would need to apply a specific class to the product listing page so that I can have a different style for that page, which won't be applied on the detail page. Currently, the body classes are exactly the same so I can't apply different styles.

Can you tell me how I can do this?

Thanks in advance.

Sandra

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

  • Posts: 83402
  • Thank you received: 13495
  • MODERATOR
3 years 6 hours ago #340108

Hi,

If you want to add extra classes to the "body" element of the page, you'll need to edit your template files. I can't say exactly how that should be done since different templates structure are different.
With the default template of Joomla, on Joomla 4, I do see different classes there though:
i.imgur.com/Cdvaokc.png
i.imgur.com/ZdGxcz1.png
So you could use .com_hikashop.view-product.task-show for the product details page and .com_hikashop.view-product.task-listing for the listings. So if your template is done properly, following what the default template does, you should see these classes.
And if not, I can only recommend you to check with your template provider.

The following user(s) said Thank You: Sandra74

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

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
2 years 11 months ago #340127

Thanks a lot Nicolas!

Found it. Issue solved.

Thanks again

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

Time to create page: 0.055 seconds
Powered by Kunena Forum