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

#   Module Assignment

##

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

Less More

- Posts: 28
- Thank you received: 0
-
-

15 years 2 months ago [\#22643](#22643) by [bora983](/forum/user/1981-bora983 "View bora983's Profile")  *[Module Assignment](/forum/4-how-to/22643-module-assignment#22643 "I have a custom HTML module which is displayed on all pages, but i want to hide it on Product Page. Is this possible, or is there another way to do that.  Thanks")* was created by *[bora983](/forum/user/1981-bora983 "View bora983's Profile")*

I have a custom HTML module which is displayed on all pages, but i want to hide it on Product Page. Is this possible, or is there another way to do that.

Thanks

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14274
-
-

15 years 2 months ago [\#22661](#22661) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Module Assignment](/forum/4-how-to/22643-module-assignment#22661 "I have a custom HTML module which is displayed on all pages, but i want to hide it on Product Page. Is this possible, or is there another way to do that.  Thanks")*

There are two solutions:
1. You set your module to a position of your template where it is alone. In the index.php of your template, you add some code around the position loading code to display or not the position based on whether it's the product page or not, like that:

if(JRequest::getVar('ctrl')=='product'&amp;&amp;JRequest::getVar('task')=='show'){
// display position modules code
}

2. You add the same PHP code around the code of your module's php file.

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

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

Less More

- Posts: 28
- Thank you received: 0
-
-

15 years 2 months ago [\#22726](#22726) by [bora983](/forum/user/1981-bora983 "View bora983's Profile")  Replied by *[bora983](/forum/user/1981-bora983 "View bora983's Profile")* on topic *[Re: Module Assignment](/forum/4-how-to/22643-module-assignment#22726 "I have a custom HTML module which is displayed on all pages, but i want to hide it on Product Page. Is this possible, or is there another way to do that.  Thanks")*

I am having trouble to get this to work. Here is code from index.php. Am i doing something wrong?

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

[ masina-shop.co.rs/index.php/odeca/product/show/231-beer-exit](http://masina-shop.co.rs/index.php/odeca/product/show/231-beer-exit)

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14274
-
-

15 years 2 months ago [\#22727](#22727) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Module Assignment](/forum/4-how-to/22643-module-assignment#22727 "I have a custom HTML module which is displayed on all pages, but i want to hide it on Product Page. Is this possible, or is there another way to do that.  Thanks")*

You need to add PHP tags around the php code. It should be like that:

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

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

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

Less More

- Posts: 28
- Thank you received: 0
-
-

15 years 2 months ago [\#22731](#22731) by [bora983](/forum/user/1981-bora983 "View bora983's Profile")  Replied by *[bora983](/forum/user/1981-bora983 "View bora983's Profile")* on topic *[Re: Module Assignment](/forum/4-how-to/22643-module-assignment#22731 "I have a custom HTML module which is displayed on all pages, but i want to hide it on Product Page. Is this possible, or is there another way to do that.  Thanks")*

Now it's working but it is opposite to what i want. Maybe i wasn't clear on first post. Now module is showing only on product page, but i want to show it everywhere except on product page.

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14274
-
-

15 years 2 months ago [\#22735](#22735) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Module Assignment](/forum/4-how-to/22643-module-assignment#22735 "I have a custom HTML module which is displayed on all pages, but i want to hide it on Product Page. Is this possible, or is there another way to do that.  Thanks")*

Then you need to do the opposite:

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyNjQzLW1vZHVsZS1hc3NpZ25tZW50P3RtcGw9bWFya2Rvd24=) 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.088 seconds

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

[](#top)
