Entering slug in "Alias & Meta"
- jiraict
-
Topic Author
- Offline
- New Member
-
Less
More
- Thank you received: 0
16 years 7 months ago #3310
by jiraict
When entering an URL-slug (for instance "...&id=3:my-article&Itemid=...") in the non-SEF URL on the page "Alias & Meta" page in the backend, the slug gets stripped. As developers of Joomla! components are encouraged to use slugs for easing the SEF-process (for sure when using the standard Joomla! SEF), this poses a big problem.
As a work-around I filled in the correct URL (including the slug) through MySQL, but I think this should be fixed in SEF Advance. I guess there needs to be an extra check added to "controllers/alias.php" to include a semi-column (":") as legal character. It appears to me that the ID is stripped down purposefully. If there is a good reason for this, perhaps it is possible to include an extra setting on the Configuration-page to NOT do this.
Another suggestion: When using the search-box on the "Alias & Meta" the search is not saved when returning to the page. When handling a lot of aliasses it is a boring process to enter the search-word over-and-over again. Is it possible to just save the search-word in the session (getUserStateFromRequest).
As a work-around I filled in the correct URL (including the slug) through MySQL, but I think this should be fixed in SEF Advance. I guess there needs to be an extra check added to "controllers/alias.php" to include a semi-column (":") as legal character. It appears to me that the ID is stripped down purposefully. If there is a good reason for this, perhaps it is possible to include an extra setting on the Configuration-page to NOT do this.
Another suggestion: When using the search-box on the "Alias & Meta" the search is not saved when returning to the page. When handling a lot of aliasses it is a boring process to enter the search-word over-and-over again. Is it possible to just save the search-word in the session (getUserStateFromRequest).
Please Log in or Create an account to join the conversation.
- Saka
-
- Offline
- Administrator
-
16 years 7 months ago - 16 years 7 months ago #3311
by Saka
Emir Sakic
www.sakic.net
Why is it a problem when alias works correctly. The user never sees the slug anyway. And it is easier if it's stripped, otherwise you would need two aliases: one for URL with and another without slug. And we know Joomla has different URLs leading to same content.
You were right about the search. I now added getUserStateFromRequest both for alias and redirects search box and it's available in v1.6.5.
You were right about the search. I now added getUserStateFromRequest both for alias and redirects search box and it's available in v1.6.5.
Emir Sakic
www.sakic.net
Last Edit: 16 years 7 months ago by Saka.
Please Log in or Create an account to join the conversation.
- jiraict
-
Topic Author
- Offline
- New Member
-
Less
More
- Thank you received: 0
16 years 7 months ago #3316
by jiraict
I agree, but the slug is generated by several components. So if the slug is there, it should be entered as a non-sef URL within "Alias & Meta". Luckily enough it concerns my own component, so I can just make a change.
But this problem most probably concerns other components as well. As soon as the URL handed over to JRoute contains a slug, you will need to use this slug in SEF Advance as well, doesn't it?
I know that for instance articles sometimes use it and sometimes they don't. The main point is that the Joomla! core team recommends to use it.
But this problem most probably concerns other components as well. As soon as the URL handed over to JRoute contains a slug, you will need to use this slug in SEF Advance as well, doesn't it?
I know that for instance articles sometimes use it and sometimes they don't. The main point is that the Joomla! core team recommends to use it.
Please Log in or Create an account to join the conversation.
- Saka
-
- Offline
- Administrator
-
16 years 7 months ago - 16 years 7 months ago #3317
by Saka
Emir Sakic
www.sakic.net
Still don't see your point. It doesn't serve any purpose other than SEO. An URL with slug or without it leads to same content. So why does it matter if it's stripped in alias? The alias still works as intended.
Unless you are using this slug in your component's logic somehow which you shouldn't do, you should use the ID:s.
Unless you are using this slug in your component's logic somehow which you shouldn't do, you should use the ID:s.
Emir Sakic
www.sakic.net
Last Edit: 16 years 7 months ago by Saka.
Please Log in or Create an account to join the conversation.
- jiraict
-
Topic Author
- Offline
- New Member
-
Less
More
- Thank you received: 0
16 years 6 months ago #3340
by jiraict
So we still don't see each others point
Communication is hard.
OK, here's my scenario: I use a component X which always generates URLs with a slug:
In the PHP-code of this component every generated URL is translated through JRoute and if some kind of automated SEF-translation is used (Joomla! SEFs "route.php" or SEF Advance "sef_ext.php") this might translate the original URL to a SEF URL like this:
This points out exactly why the slug is very useful. Instead of using an ID you can create custom URLs automatically by using an unique alias. If the alias is not unique, we HAVE to use either the ID or the slug. But that's up to the component, not the SEF plugin, to decide.
So here is one very good reason why components should always a slug instead of just an ID. Not only will it make it much easier to have some weak kind of SEF (like "/mycontent/3,myslug/Itemid,3/some,extra/") but also allows for die-hards to create their own "route.php" or "sef_ext.php" rules to really translate an original Joomla! URL into a SEF URL.
Actually we are NOT talking about SEF URLs here, but human-readable URLs.
So I hope you get my view on slugs, which is slightly different from your point of view.
But my problem to begin with, was that I couldn't enter a slug in the "non-SEF URL" field under the "Aliasses" tab. This poses another very simple problem:
If I'm using a component which ONLY generated slugs, and I want to use manual aliasses for this instead of automatic SEF. Then I will need to fill in the correct URL as "non-SEF URL":
Within the HTML-code this "non-SEF URL with slug" is used, so unless I can exactly use this URL as an alias within SEF Advance, SEF Advance will never use an alias for this and will always use the automated translation process for turning this URL into a SEF URL.
So in general: It is NOT possible to use SEF Advance aliases together with components that create slugs in their non-SEF URLs.

OK, here's my scenario: I use a component X which always generates URLs with a slug:
index.php?option=com_customcomponent&id=3:a-slug
In the PHP-code of this component every generated URL is translated through JRoute and if some kind of automated SEF-translation is used (Joomla! SEFs "route.php" or SEF Advance "sef_ext.php") this might translate the original URL to a SEF URL like this:
/example/a-slug
This points out exactly why the slug is very useful. Instead of using an ID you can create custom URLs automatically by using an unique alias. If the alias is not unique, we HAVE to use either the ID or the slug. But that's up to the component, not the SEF plugin, to decide.
So here is one very good reason why components should always a slug instead of just an ID. Not only will it make it much easier to have some weak kind of SEF (like "/mycontent/3,myslug/Itemid,3/some,extra/") but also allows for die-hards to create their own "route.php" or "sef_ext.php" rules to really translate an original Joomla! URL into a SEF URL.
Actually we are NOT talking about SEF URLs here, but human-readable URLs.
So I hope you get my view on slugs, which is slightly different from your point of view.
But my problem to begin with, was that I couldn't enter a slug in the "non-SEF URL" field under the "Aliasses" tab. This poses another very simple problem:
If I'm using a component which ONLY generated slugs, and I want to use manual aliasses for this instead of automatic SEF. Then I will need to fill in the correct URL as "non-SEF URL":
index.php?option=com_customcomponent&id=3:a-slug
Within the HTML-code this "non-SEF URL with slug" is used, so unless I can exactly use this URL as an alias within SEF Advance, SEF Advance will never use an alias for this and will always use the automated translation process for turning this URL into a SEF URL.
So in general: It is NOT possible to use SEF Advance aliases together with components that create slugs in their non-SEF URLs.
Please Log in or Create an account to join the conversation.
- Saka
-
- Offline
- Administrator
-
16 years 6 months ago #3341
by Saka
Emir Sakic
www.sakic.net
OK I get your point.
I still think that one should use the ID, not the slug part in the component's logic so the both links can work but you have a valid point there: it's not up to SEF component to decide.
So I will be looking into it and fix it for alias in next version.
I still think that one should use the ID, not the slug part in the component's logic so the both links can work but you have a valid point there: it's not up to SEF component to decide.
So I will be looking into it and fix it for alias in next version.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.