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
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
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.
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?
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?
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
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.
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) ?
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
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.