Search
Other Advanced Module Manager questions
Forum

Module appears on all pages in component

Richard Fontaine's Avatar Richard Fontaine
Hi,
the modules still appear in the component pages that are not attached to a menu link (they don't appear when part of the menu).
I use version 9.1.1 on joomla 4.1.2, php 7.4.
Unfortunately i am still on localhost so it may be difficult to give you access if needed.
Regards
Richard Fontaine
Peter van Westen's Avatar Peter van Westen ADMIN
Not sure I follow.

What assignments have you set up for the module?
Please post a rating at the Joomla! Extensions Directory
Richard Fontaine's Avatar Richard Fontaine
Here they are:
- include : a list of pages accessible through the joomla menu (not the custom component)
- Also on child items: no
- Include no itemid: no


It seems i can't attach images in this forum otherwise I would have copied the conditions page
Peter van Westen's Avatar Peter van Westen ADMIN
The way Joomla works is that items that have no menu item of their own, will inherit the menu item of the page linking to them. If you switch off SEF URLs on your site, you will see that those links also have an Itemid=... in the URL.

That means that modules assigned to those menu items will also show on the pages inheriting that active menu item.
This is how the core module assignments work too.

If you only want to show it on a specific URL, and not on the pages using the same active menu item, then I suggest you use the URL condition rule instead.
Please post a rating at the Joomla! Extensions Directory
Richard Fontaine's Avatar Richard Fontaine
Hi,
Thanks

Is that different from Joomla 3, because the problem I have is on a test version to switch to joomla 4, and I didn’t have that issue before?
I have tried to add a condition to exclude the whole component but it did not work. Actually i could not add a « And » condition but a « or » only on that exclude.
How can I exclude the whole component urls then?
Peter van Westen's Avatar Peter van Westen ADMIN
The way menu assignments work has not changed.

How do you mean you cannot create an 'AND' condition?
Please post a rating at the Joomla! Extensions Directory
Richard Fontaine's Avatar Richard Fontaine
when I add the condition to exclude the component, a « or » is displayed between the first condition (inclusion of some urls) and this latter condition.
I expected to be able to choose between a « and » and a « or ».
Can you please tell how to exclude whole component urls then?
Peter van Westen's Avatar Peter van Westen ADMIN
You can change the Matching Method to ALL or ANY.

Please read: docs4.regularlabs.com/advancedmodulemanager/conditions/overview
Please post a rating at the Joomla! Extensions Directory
Richard Fontaine's Avatar Richard Fontaine
Hi peter,
thanks for your answers; i was confused about the "all" and "any" with the new interface of your component. That works fine now for this.
However the conditions still don't work well when in a component pages.

I have checked about the Itemid in the component.
I actuall don't have ItemIds in the component pages that are not assigned to a menu page.
And though I have the "Include no Itemid: No" in the conditions, they are assigned to it.
My hypothesis is that this "Include no Itemid: No" is not working and that is what changed (as i asked before) between joomla 3 and 4 (or the adaptation of your component), because i did not change any module and condition betweeen the two but the actual behaviour is completely different.
Can you please have a look?
kind regards
Peter van Westen's Avatar Peter van Westen ADMIN
Can you check what your urls look like when switching off SEF URLs?
Please post a rating at the Joomla! Extensions Directory
Richard Fontaine's Avatar Richard Fontaine
I checked with SEF switched off
Peter van Westen's Avatar Peter van Westen ADMIN
Yes, the question is: what do the URLs look like that are showing those modules?
Do they have an &Itemid=.... in them?
Please post a rating at the Joomla! Extensions Directory
Richard Fontaine's Avatar Richard Fontaine
I am no longer at the office. But there is no itemId at all in the url. For further clarification, the word/parameter « ItemId » is not present.
Peter van Westen's Avatar Peter van Westen ADMIN
Can you give me (super) admin and (s)ftp access so I can take a look?
And tell me on what url I can see/reproduce the issue.
And what module (id) this concerns...
You can use the 'Confidential information' button in the forum editor to hide sensitive information.
Please post a rating at the Joomla! Extensions Directory
Richard Fontaine's Avatar Richard Fontaine
The problem I have so that I am on localhost,and to be able to put it on a public server, I need it to have php 7.4. And the only one I have is the production one and I can’t update it to 7.4 because current code is not compatible.
Unless you have an idea of how I can do that ? Can I give you acces to a localhost(after all it is also a server) ?
Peter van Westen's Avatar Peter van Westen ADMIN
No, you can't give me access to your local setup.

If you can reproduce this on an online environment to which I can get access, I am happy to look into this.
Please post a rating at the Joomla! Extensions Directory
Richard Fontaine's Avatar Richard Fontaine
Hi Peter,
I cae back to this today and found the issue.
Joomla 4 handles ItemId a bit differently than in J3 where it was still adding and ItemId in component without it.
Now it doesn't BUT it puts a default Itemid in the actual id here. " JFactory::getApplication()->input->getInt('Itemid', 0);"
In your code when you do the test about "noItemid" your still get an ItemId (the one of the home menu, which seems to be the default one) that you get from your getRequest() function in your file administrator/components/com_conditions/src/Condition/Condition.php.

I am not usere i understood everything but I could find a trick (i have to see if it always wokrs) by adding a kind of fake ItemId in my component.
SInce you are familiar with all of this, maybe you could suggest another nad mybe smarter way to handle this ?
regards
Richard
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
So you are right, the Itemid works differently in Joomla 4 than Joomla 3.
Not just in Advanced Module Manager, but in core Joomla.
There should be no cases where URLs have no Itemid (active menu item).
Joomla will always set an active menu item. If a component is not attached to a menu item, it will use the default menu item as the active one.

This means that the "Include no itemid" option is useless in Joomla 4.
I have therefor removed it.

If you only want to have a module be shown on the homepage and not on pages that default to the homepage menu item, then you indeed need to use the "Homepage" condition rule.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription