Context : Router is set to Modern and Remove IDs is set to Yes
Issue summarized : if there is a link to an article having no direct menu item ("single article") or no indirect menu item (link to some Parent Category, "category blog") then the link to that article will not work properly and lead incorrectly to the homepage of the site
Links between articles should always work
In an article (having in my case ID 23 called in my case "how-to-open-a-link-in-a-modal-window". In FR), I make a native link to another article (having in my case the ID 57 with alias is i-9-36. Also in FR)
Knowing that Router is set to Modern,
when "Remove IDs" is set to NO then
the url of the source page is /fr/tutorials/23-how-to-open-a-link-in-a-modal-window
and the link to article 57 is converted to /fr/tutorials/57-i-9-36 and leads correctly to the article
when "Remove IDs" is set to YES then
the url of the source page is /fr/tutorials/how-to-open-a-link-in-a-modal-window
and the link to article 57 is converted to /fr/tutorials/i-9-36... and leads incorrectly to the homepage !?
BUT if I create a Menu Item pointing to some Parent Category of that article, then the SEF url follows the logic the /fr/category/subcategory/article and it works !
Note for the context : the reason why there was no Menu Item like for each article is that the website has thousands or articles (legal texts)
J!3.9.2
If this is considered "normal behaviour", at least I post it here so that people having issues with Modern Router without IDs understand & have a workaround
It has been explained that one always need, even as hidden, a "All categories" menu item for articles, contacts, etc, to be sure to get a nice sef url when using the so called "Modern" Routing.
Alas...
Explaining a bug doesn't make it less of a bug.
Modern Router as such is fine. It is only when the option "Remove IDs
" is set to Yes that the bug arises.
BTW, where is it explained ?
A more proper behavior would be a fallback
a fallback like not removing the IDs from the URL ?
And parameter should be "Remove IDs if possible" ?
Explaining a bug doesn't make it less of a bug.
Exactly. It is a bug - you should not have to create a work around
It has been explained that one always need, even as hidden, a "All categories" menu item for articles, contacts, etc, to be sure to get a nice sef url when using the so called "Modern" Routing.
My approach in (not same but) similar situation is to force automatic creation of 1 or more menu items, if needed menu item(s) are "missing" , that use some generic name and generic alias
Just a word on the context : on small (or medium) websites, this case would probably not arise often since typically every article would indeed have "its Menu Item".
I came across this issue bc I am working on a huge website (2000+ articles) commenting some Law.
So a lot of Joomla Articles don't deserve a menu item bc they are just called in a Modal (btw, this means also that nobody ever sees their URL).
Example of real content : "In the second paragraph of the new Law (...)" where second paragraph opens the paragraph in question (a Joomla Article) in a Modal.
(and so it took me a long time to understand the reason why that Modal would show the Homepage instead of the article in question in some cases but not in all cases)
Status | New | ⇒ | Discussion |
Labels |
Added:
J3 Issue
|
Status | Discussion | ⇒ | Confirmed |
Please change label to j4
Labels |
Added:
No Code Attached Yet
J4 Issue
Removed: J3 Issue ? |
Labels |
Added:
bug
|
I know this was reported a long time ago. I just ran into this and luckily found this open issue. While it doesn't fix the problem, I'm appreciative of the workaround that @infograf768 posted above.
Is this still being worked on or has it been sidelined for now?
Don't expect any changes here soon.
Don't expect any changes here soon.
Thank you for the reply @Hackwar.
So until the time comes, the only way to do this successfully is to use the workaround which is to
add a hidden menu item
select Article, then "List All Categories"
and either select "Root" for the "top level category" or select the category we're interested in showing.
Just to add to this:
So issue is that - when using the Modern URL Router and
Remove IDs
is set to YES - urls to articles do NOT work when they do not have a menu item attached to it (or its category).A non-SEF url like:
is converted to a SEF url when passed through the
JRoute::_()
and returns a url like:However, that url does NOT work and redirects to the homepage.