[Skip to main content](#vessel-content)

#   Module only on product detail page

##

- **[further](/forum/user/10547-further "View further's Profile")**
- [![further's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/10547-further "View further's Profile") Topic Author
- [ Offline](/forum/user/10547-further)

Less More

- Posts: 20
- Thank you received: 0
-
-

13 years 11 months ago -  13 years 11 months ago [\#77356](#77356) by [further](/forum/user/10547-further "View further's Profile")  *[Module only on product detail page](/forum/4-how-to/75925-module-only-on-product-detail-page#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...")* was created by *[further](/forum/user/10547-further "View further's Profile")*

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](http://www.hikashop.com/en/forum/4-how-to/22643-module-assignment.html) 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:

&lt;div id="extra1"&gt; &lt;?php if(JRequest::getVar('ctrl')=='product'&amp;&amp;JRequest::getVar('task')=='show'){ ?&gt; &lt;jdoc:include type="modules" name="extra1" style="xhtml" /&gt; &lt;?php } ?&gt; &lt;/div&gt;

Last edit: 13 years 11 months ago by [further](/forum/user/10547-further "View further's Profile"). Reason: added code

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc1OTI1LW1vZHVsZS1vbmx5LW9uLXByb2R1Y3QtZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

13 years 11 months ago [\#77370](#77370) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Module only on product detail page](/forum/4-how-to/75925-module-only-on-product-detail-page#77370 "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...")*

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 &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [further](/forum/user/10547-further "View further's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc1OTI1LW1vZHVsZS1vbmx5LW9uLXByb2R1Y3QtZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[further](/forum/user/10547-further "View further's Profile")**
- [![further's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/10547-further "View further's Profile") Topic Author
- [ Offline](/forum/user/10547-further)

Less More

- Posts: 20
- Thank you received: 0
-
-

13 years 11 months ago [\#77384](#77384) by [further](/forum/user/10547-further "View further's Profile")  Replied by *[further](/forum/user/10547-further "View further's Profile")* on topic *[Module only on product detail page](/forum/4-how-to/75925-module-only-on-product-detail-page#77384 "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...")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc1OTI1LW1vZHVsZS1vbmx5LW9uLXByb2R1Y3QtZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.053 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
