How to hide the module that assigned to category page from product page?

28.09.2016 15:48
#1
aminmix
Joomshopping forum user no avatar
Name: Amin
17.02.2013
Posts: 11
Quote
How to hide the module that assigned to category page from product page?

Hi
I have assigned a Joomla 3 module to a joomla category page in a template position. The module exists in that category page but this module is visible in all of products page in that category.
How can i put a module just in a category page and prevent the module from existing in product detail pages.


Joomla: 3.4.5
JoomShopping: 4.11.1
 
28.09.2016 16:02
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25852
Quote
Aw: How to hide the module that assigned to category page from product page?

add code in your template (example position-1 )

<?php if (JRequest::getVar('controller')!='product'){?>
<jdoc:include type="modules" name="position-1" />
<?php }?>

 
28.09.2016 16:29
#3
aminmix
Joomshopping forum user no avatar
Name: Amin
17.02.2013
Posts: 11
Quote
Aw: How to hide the module that assigned to category page from product page?

Good solution , Thank you

 
09.02.2023 19:42
#4
hgjkty
Joomshopping forum user no avatar
Name: erwtu
26.12.2013
Posts: 5
Quote
Aw: How to hide the module that assigned to category page from product page?

Good afternoon,
Firstly, thank you for your helping answer. I'm trying to insert this code on my product default template but every time I try it it gets an error when I go to a product page.
I think that I'm not modifying the correct file, could you help me? I'm modifying this file: /public_html/components/com_jshopping/templates/default/products/products.php

And where do I have to copy the php code, because I'm trying to insert it at the end of the file and it doesn't work.

It would be very useful if you could explain me which file and where do I have to modify. I'm using Joomla! 4 and experimenting the same issue, a module which I have on a category page appears on all products of this category.

Thank you very much,

Josep Mencion


Joomla: 4.2.6
JoomShopping: last
 
09.02.2023 20:33
#5
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25852
Quote
Aw: How to hide the module that assigned to category page from product page?

add code in your template Joomla (example position-1 )

<?php if (\JFactory::getApplication()->input->get('controller')!='product'){?>
<jdoc:include type="modules" name="position-1" />
<?php }?>

Example file:
templates\cassiopeia\index.php

 
10.02.2023 10:05
#6
hgjkty
Joomshopping forum user no avatar
Name: erwtu
26.12.2013
Posts: 5
Quote
Aw: How to hide the module that assigned to category page from product page?

Thank you for your answer.

I have tried to include the code in the body section, on the index.php of my template, and it doesn't work.

I attach you a screenshot, if you could help me I would be really grateful.

Thank you very much.

Josep Mencion
Aw: How to hide the module that assigned to category page from product page?

 
10.02.2023 10:14
#7
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25852
Quote
Aw: How to hide the module that assigned to category page from product page?

it doesn't work...
?

error?
or
module displayed for all page
or module displayed .......

 
11.02.2023 08:22
#8
hgjkty
Joomshopping forum user no avatar
Name: erwtu
26.12.2013
Posts: 5
Quote
Aw: How to hide the module that assigned to category page from product page?

Hello,
Sorry for the delay on the answer. When I add this code on the body section (which is on the html section) of the file index.php and modifying "position-1" for my position, which is "call-to-action", the modules appear twice, one on the call-to-action position, and another time after the footer, and on all pages of the website.

And what I expected was to disappear from the product pages the modules which are assigned to a category page (because when I assign a module to a category, it appears on all product pages, and that's what I want to remove).

I attach you an image which I have made small so that the two blocks fit and look.

Thank you very much,

Josep Mencion
Aw: How to hide the module that assigned to category page from product page?

 
11.02.2023 11:23
#9
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25852
Quote
Aw: How to hide the module that assigned to category page from product page?

You just need to paste the code in the right place.
--------------------------------------------------------------
For order development use Kontakt.

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.