Module only on product detail page

  • Posts: 20
  • Thank you received: 0
11 years 11 months ago #77356

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

<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: 11 years 11 months ago by further. Reason: added code

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77370

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: further

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

  • Posts: 20
  • Thank you received: 0
11 years 11 months ago #77384

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.056 seconds
Powered by Kunena Forum