Factory::getApplication()->input
contains the [layout] with value 'blog' even for an article, and not just for a category.
That is weird, because [layout] = 'blog' is a category parameter, not an article parameter.
The layout parameter should only appear in the Factory::getApplication()->input if a custom layout is set as an article level (with a dedicated menu item for that article layout). It should not be inherited from the category layout value, it makes no sense.
When view=article, Factory::getApplication()->input should not inherit the [layout] variable from the category parameters.
But currently the [layout] variable is inherited in the article view from the category parameters.
Joomla 4.3.2
| Labels |
Added:
No Code Attached Yet
|
||
The issue is that when requesting Factory::getApplication()->input when in an article view, the [layout]="blog" variable is included in the array of variables (inherited from the category view).
It shouldn't, because [layout]="blog" is a category input var, not an article input var.
| Labels |
Added:
bug
|
||
Still an issue as of Joomla 6 by the way
is the only issue is that layout=blog appears in the input, with no adverse effect on the rendered page or other functionality. Changing core code could introduce more problems than it solves.
In theory it allows to have tmpl/article/blog.php (and the override for it in the template) for an Article detail for Category blog menu.
Currently there are fallback to default.php layout :
joomla-cms/libraries/src/MVC/View/HtmlView.php
Lines 404 to 407 in bd77f0e
Fixing requested issue can break someone site 😉
For example SEF extensions that generate URLs, eg. 4SEF, when they encounter URLs with layout=blog they store a duplicate URL for the same article. They said at the time they wouldn't fix it on their end "because its a Joomla issue"
7. In theory it allows to have
tmpl/article/blog.php(and the override for it in the template) for an Article detail for Category blog menu.
Currently there are fallback todefault.phplayout :
joomla-cms/libraries/src/MVC/View/HtmlView.php
Lines 404 to 407 in bd77f0e
Fixing requested issue can break someone site 😉
Not true. In these cases the layout is never in the nonsef URL, it is computed automatically like the other params. An article nonsef never has a layout query string
I just pointing that this feature can be used by someone.
And it is actualy not a bad feature.
An article nonsef never has a layout query string
That sounds like we need to fix that, and add blog layout to articles inside category blog :)
This way we do not break anything.
I not sure what exactly 4SEF doing, but their URLs should be the same as in the Joomla menu, otherwise what the point of generating random URLs ;)
I just pointing that this feature can be used by someone.
And it is actualy not a bad feature.
An article nonsef never has a layout query string
That sounds like we need to fix that, and add blog layout to article URLs inside the category blog :)
This way we do not break anything.
I not sure what exactly 4SEF doing, but their URLs should be the same as in the Joomla menu, otherwise what the point of generating random URLs ;)
I just pointing that this feature can be used by someone.
And it is actualy not a bad feature.
An article nonsef never has a layout query string
That sounds like we need to fix that, and add blog layout to article URLs inside the category blog layout :)
This way we do not break anything.
I not sure what exactly 4SEF doing, but their URLs should be the same as in the Joomla menu, otherwise what the point of generating random URLs ;)
I just pointing that this feature can be used by someone.
And it is actualy not a bad feature.
The layout is used but it does not produce a different nonsef. Fixing this issue would not break the layout functionallity for articles, because it does not change the nonsef (it never has and it shouldn't).
That sounds like we need to fix that, and add blog layout to article URLs inside the category blog layout :)
What? Absolutely not. 'blog' is a category layout parameter. It has nothing to do with the article.
I not sure what exactly 4SEF doing, but their URLs should be the same as in the Joomla menu, otherwise what the point of generating random URLs ;)
I found the cause of the issue. It's the login module. When you have the login module enabled on the site, Joomla produces some nonsef URLs appending the faulty &layout=blog parameters to articles. It doesn't do it when normally building menu items. Really weird.
I found the cause of the issue. It's the login module. When you have the login module enabled on the site, Joomla produces some nonsef URLs appending the faulty &layout=blog parameters to articles. It doesn't do it when normally building menu items. Really weird.
I can not replicate that
You're right I can't reproduce it on a fresh Joomla install either. Super weird. I will let you know if I'm able to pinpoint the cause...
I don't understand your issue. Could you describe what exactly you are doing?