Creating a system item alias and hitting save errors saying the alias already exists if the menu item has the same name as the original. As it goes to the same place this could be quite common.
Menu item either saves manually if entered, but if not entered saves as the same name with "-alias" appended.
I might event be able to code this (he says wistfully). But I won't do it if there's a reason not to.
Labels |
Added:
No Code Attached Yet
|
I don't understand the request. Please provide exact steps to reproduce. Thanks.
Labels |
Added:
Information Required
|
Title |
|
It was a RFC. I clicked that button but I guess it's not clear.
Create a menu item. It creates an alias, unless one of the same already exists. Then I have to create one. This makes sense.
I create a system > alias. It creates an alias, it already exists, but the alias for a system alias is never used. Or have I got that wrong? I assumed it just used the URL of the original menu item.
Therefore, it doesn't actually matter what it is. If that's the case, let's just do this automatically for the users. And possibly even disable it altogether (although I don't often advocate for that and I bet some users have a reason for not doing that).
I'm suggesting we just do "menu-name-with-hypens-alias" as the alias. But you may well tell me I'm way off the mark.
Is this about Separator
and not Menu Item Alias
?
It's about menu item alias AND it's about creating the alias for the menu item alias. Does that make sense? Or do you have other questions perhaps that I can help to clarify what I mean?
@uglyeoin I get it.
When you create a menu item (any type) and save, then an alias is created unless it already exists in which case you are prompted to manually create an alias.
What I believe @uglyeoin is suggesting is that instead of being prompted to create an alias manually it is automatically created with (perhaps) a number added to the alias. Which is the behaviour when you save an article
I'm sure it's me being uneducated, but I don't see the point in an alias for the system > alias at all. Surely it will always use the alias of the original article. So I wouldn't mind if it added a number, or even some gibberish if it's never used. But I'm guessing I'm wrong and it can be used somewhere
you could tell someone to type in the url or create a link to the url
I see. I guess that could be useful to create shorter links. Could also be achieved with the redirect plugin.
Aliases are used by Joomla to make Search Engine Friendly URLs so auto appending -alias
or a number is probably not preferred. Sorry I am still not understanding the request/issue.
I understand and I am too. The alias value will be part of the URL so I am trying to understand why you would want to append -alias
or a number in the URL instead of a custom value.
Mmmh, in the case of a Menu Item of Type "System > Alias", the "Slug" (sorry to use such a bad word here, I wanted to avoid the word Alias since it is ambiguous in the current context) is completely useless, isn't it?
What I mean is: if indeed the "Slug" is not used anywhere (in any URL or whatever) then
you could tell someone to type in the url or create a link to the url
Labels |
Added:
Feature
|
I am not sure if it is intended but if I create a "menu item alias" and set the field alias to "myShorUrl" I can access the connected menu item with /myShortUrl. This will then create dublicated content because the same content is available under two different URLs. I am pretty sure some has used this as a trick to make shorter URL. My personal view on this is that it is a bug and the alias of a menu item alias should not be used at all and we should not require that it has to be set.
No it does not create duplicate content.
Here is a real world example.
I have a top level menu item with as "myShorUrl" that is an alias to a sub-level menu item
If I type the "myShorUrl" I am redirected to the sub-level menu item
If you visit the alias in your browser (https://www.sinaileeds.uk/agm-2024)
You will be redirected to the actual menu item (https://www.sinaileeds.uk/news/sinai-agm-2024)
The thing is, you can also achieve this with redirects. The difference being with redirects you would get information on the number of hits. So I believe that should be the recommended method. Is that everyone else's opinion? Or is there a different opinion? I understand this would be a breaking change for some people who use Brian's method (which is perfectly valid).
I have tested this with the blog sample data and made a alias to the love article with the alias blog0815 and I get the content of the article when I add /blog0815 to then home url. There might be a different settings, but at my site it is as I wrote
The thing is, you can also achieve this with redirects.
There are always multiple ways to achieve everything
The difference being with redirects you would get information on the number of hits.
Using redirect manager to measure hits is a strange way of working as it only tracks a small % of the hits to your site. Surely if you care about such things (I do not) then you would use a real counter
So I believe that should be the recommended method. Is that everyone else's opinion? Or is there a different opinion? I understand this would be a breaking change for some people who use Brian's method (which is perfectly valid).
Recommended or not it would be a breaking change and the only benefit would be that occasionaly when creating the alias you have to go a step further than normal
I have tested this with the blog sample data and made a alias to the love article with the alias blog0815 and I get the content of the article when I add /blog0815 to then home url. There might be a different settings, but at my site it is as I wrote
you have misunderstood the issue but thats fine. ITs not relevant to the reported issue
Recommended or not it would be a breaking change and the only benefit would be that occasionaly when creating the alias you have to go a step further than normal
Actually I think the benefit would be that users receive a confusing error message. I think it's a usability issue and it makes the system "seem" less well built. But I agree it's a minor issue and very likely often unused future by newer users. It would be difficult to argue for removal. It would be easier to argue for functionality that automatically does something to save it and then reports that e.g. we've added a 1 to the end of your alias as it already existed, or we have added the word alias in front of your alias as it already existed.
I dont disagree with that and I already said I agree #42811 (comment)
The change I was against was your suggestion that redirects were used instead
The redirects bit I hadn't realised were so unreliable. But I would still argue it's better practice. But I wouldn't argue strongly because I don't really care enough and there's minimal benefit lol
We discussed this yesterday in the weekly maintainers meeting. We agree we should make this more consistent, but this is one of the things we want to look at when we fix some of the router issues we have.
Do you mean that if the alias is not entered, the system adds - to the alias in this way? "i use joomla 4"