Skip to main content

Module only on product detail page

More
13 years 10 months ago - 13 years 10 months ago #77356 by further
I created a custom html module that I only want to show on my product detail pages. I have assigned them to the menu items of the product list from the category so of course it is showing when the list of all items in that category are showing. I want it only to show when someone clicks to the detail of the product.

I found this post and tried the solution but when I did it ended up hiding the module entirely. Not sure if there is a new way to do this since this post was over a year old.

Any pointers as to how I might be able to achieve this?

Here is the code from my index
Code:
<div id="extra1"> <?php if(JRequest::getVar('ctrl')=='product'&&JRequest::getVar('task')=='show'){ ?> <jdoc:include type="modules" name="extra1" style="xhtml" /> <?php } ?> </div>
Last edit: 13 years 10 months ago by further. Reason: added code

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

More
13 years 10 months ago #77370 by Jerome
Hi,

I didn't see anything wrong in the code.
Did you create the slot in your template ? did you assign the slot to your module ?
If you removed the "if", is your module visible ?

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: further

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

More
13 years 10 months ago #77384 by further
I tried it without the "if" and then the page went completly blank so I put it back in. Yes I did have a slot in my template as well as the module assigned but I decided to select all the parent categories instead of just the sub menu item as I had it set before and now it is working as expected. Not sure why that would affect anything at all but it is working for me now. Many thanks.

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

Time to create page: 0.213 seconds
Powered by Kunena Forum