User tests: Successful: Unsuccessful:
The request is to use the same principle for creating links to articles in content modules. Since catslug is used in some modules and is not used in other module, this potentially leads to double article URLs (when SEF is disabled). But there is no need to use catslug in Joomla 3.x because process link function - ContentHelperRoute::getArticleRoute - requires only catid (integer value).
/components/com_content/helpers/route.php
public static function getArticleRoute($id, $catid = 0, $language = 0)
After going deeper into the issue I came to conclusion that only catid must be used, and catslug must be removed.
Steps to reproduce the issue
The results I got:
Articles Category Module
http://test.com/index.php?option=com_content&view=article&id=49:article-alias&catid=12:category-alias&Itemid=101
Articles Newsflash Module
http://test.com/index.php?option=com_content&view=article&id=49:article-alias&catid=12&Itemid=101
Expected result
http://test.com/index.php?option=com_content&view=article&id=49:article-alias&catid=12&Itemid=101
All the links to the same article must be identical in all modules. Otherwise, it's a serious SEO mistake.
Labels |
Added:
?
|
@brianteeman
Yes, some people do that (SEF disabled by default).
From time to time my clients request help about different URLs to articles.
It's good that SEF enabled helps to avoid double URLs to articles. But I think it's even better not to create this problem at all.
Category | ⇒ | Front End Modules |
In short, I don't know if we can safely remove catslug as third-party extensions may rely on that part of the URL parameter.
You can't remove $item->catslug
. Not so much because of 3rd parties but because of template overrides which may use it.
However you can deprecate it and remove the useage of it.
On the other hand, it may be the wrong approach and the category slug should actually be present always like the article slug. Don't know why com_content itself doesn't use it to be honest.
@yanivRozenman thanks for the test.
You can't remove $item->catslug. Not so much because of 3rd parties but because of template overrides which may use it.
I would more broadly say that we can't guarantee how it's being used and that removing any URL parameter is a backwards incompatible break.
I'd rather see it deprecated and remove it in 4.0 if it is deemed safe to remove.
What I know is that module layouts/templates use ready links ($item->link) but no $item->catslug is ever used.
The point is, you don't know that. A template or an extension may use it for whatever reason.
Removing the item property would break it without any warning beforehand.
According to our development strategy, we deprecate things and remove it with the next major version. Which would be 4.0.
Setting to Needs Review for a maintainer to decide on the B/C issues mentioned by @Bakual
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4363.
Status | Pending | ⇒ | Needs Review |
This doesn't need a review since already two PLT members said that it's not B/C.
Leave the catslug property there and we can look at it again.
Thanks. Setting info required to wait for an update or this will be closed in a few weeks
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4363.
Status | Needs Review | ⇒ | Information Required |
The purpose of this PR is to get rid of double article URLs created by content modules, and make these URLs to comply with article URLs generated by core content component (which doesn't use catslug).
This problem exists now and I think that it would be great to solve it in the next release, not in the distant future.
The only objection to this PR is a weak possibility that:
1. Some third party template builder (not an extension but a template)
2. includes this module layout to use it in template overrides
3. and changes this layout so much that it starts using catslug for some reason I cannot imagine.
Well, I agree that this is potentially probable. But the probability of this is negligible.
If it's the only objection that prevents this request from being accepted for the next release, then I have a suggestion:
Leave $item->catslug
available but remove it only from article URLs generated by content modules, so that these URLs are the same as generated by core content component.
If it's the only objection that prevents this request from being accepted for the next release, then I have a suggestion:
Leave $item->catslug available but remove it only from article URLs generated by content modules, so that these URLs are the same as generated by core content component.
Exactly that. Leave the $item->catslug property available but don't use it yourself. Then it is fully B/C.
If you want to make it perfect, you can add a deprecated notice somewhere.
Exactly that. Leave the $item->catslug property available but don't use it yourself. Then it is fully B/C.
If you want to make it perfect, you can add a deprecated notice somewhere.
Done. Now there should not be any B/C problems.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-12-14 07:56:18 |
Does anyone ever use Joomla with SEF completely disabled?
On 27 September 2014 10:51, shur notifications@github.com wrote:
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/