Using a different Joomla template style for product detail page

  • Posts: 175
  • Thank you received: 5
6 days 19 hours ago #306693

-- url of the page with the problem -- : n/a
-- HikaShop version -- : 4.1.0
-- Joomla version -- : 3.9.6
-- PHP version -- : 7.1
-- Browser(s) name and version -- : chrome
-- Error-message(debug-mod must be tuned on) -- : n/a

My client asked me if it would be possible to display the Product Detail page without the large graphic banner at the top he otherwise likes for the other pages.

Essentially, the template is designed so that the upper part of the site has a logo, a large banner (where slideshows usually go) and the menu.
He would like to simplify the product detail page and eliminate the vertical space now used by the graphic so that customers wouldn't have to scroll down to reach the product details.

I can easily create a template style without the graphic, but I am not sure how to associate that template style only to the product detail page, since they don't usually have a page ID and creating a menu entry for each product would not be a viable solution.

I should also specify that I use Gantry 5 as my template framework, so creating additional styles is very easy.

I searched the forum and I found several possible solution, nothing specific but close enough, but all of them were older than 4 years and I don't trust using code snippets that old.

Is there a way to assign a different template style to all product detail pages?
I suppose that if I could inject a class in the <body> tag for Product details pages, it would be just as good, as I can make the viewport eating graphic go away in CSS , but on a side by side comparison, I don't see a different set of classes in the body between category view and product detail view.
Hopefully, there is a way to handle that.

Thank you.

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

  • Posts: 175
  • Thank you received: 5
6 days 18 hours ago #306694

Well, I am an idiot. There is indeed a class in the <body> tag that allows me to hide the banner.

For future reference, that class is:
.view-category for category pages
.view-product for product details pages.

It still would be desirable to be able to assign a sub-template (or whatever they are called) instead of using CSS, but having the class in there is great. Unfortunately, the banner also contains the logo, so I'll have to do some fancy coding to make the logo appear someplace only in product pages. Could be a lot worse.

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
4 days 10 hours ago #306722

Hi,

What you can also do is use Advanced Modules Manager. It has settings for modules to display them or not based on conditions. And it has integrations with HikaShop to be able to restrict modules display by HikaShop page type or by HikaShop category or Hikashop product, etc.

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

  • Posts: 175
  • Thank you received: 5
4 days 39 minutes ago #306745

That's a great idea too! I do use Advanced Module Manager all the time. Not on this site but that's a great idea for displaying the logo. Thank you. I should have thought about it.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum