Feature No Code Attached Yet Information Required
avatar uglyeoin
uglyeoin
13 Feb 2024

Problem identified

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.

Proposed solution

Menu item either saves manually if entered, but if not entered saves as the same name with "-alias" appended.

Open questions

I might event be able to code this (he says wistfully). But I won't do it if there's a reason not to.

avatar uglyeoin uglyeoin - open - 13 Feb 2024
avatar joomla-cms-bot joomla-cms-bot - change - 13 Feb 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Feb 2024
avatar TheNourhan
TheNourhan - comment - 18 Feb 2024

Do you mean that if the alias is not entered, the system adds - to the alias in this way? "i use joomla 4"
Screenshot 2024-02-18 182929

avatar Quy
Quy - comment - 19 Feb 2024

I don't understand the request. Please provide exact steps to reproduce. Thanks.

avatar Quy Quy - change - 19 Feb 2024
Labels Added: Information Required
avatar Quy Quy - labeled - 19 Feb 2024
avatar uglyeoin uglyeoin - change - 19 Feb 2024
Title
When saving a menu item type system > menu alias could the alias be automatically created rather than manually?
RFC When saving a menu item type system > menu alias could the alias be automatically created rather than manually?
avatar uglyeoin uglyeoin - edited - 19 Feb 2024
avatar uglyeoin
uglyeoin - comment - 19 Feb 2024

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.

avatar Quy
Quy - comment - 20 Feb 2024

Is this about Separator and not Menu Item Alias?

avatar uglyeoin
uglyeoin - comment - 20 Feb 2024

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?

avatar brianteeman
brianteeman - comment - 20 Feb 2024

@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.
image

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

image

avatar uglyeoin
uglyeoin - comment - 26 Feb 2024

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

avatar brianteeman
brianteeman - comment - 26 Feb 2024

you could tell someone to type in the url or create a link to the url

avatar uglyeoin
uglyeoin - comment - 26 Feb 2024

I see. I guess that could be useful to create shorter links. Could also be achieved with the redirect plugin.

avatar Quy
Quy - comment - 27 Feb 2024

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.

avatar joomdonation
joomdonation - comment - 27 Feb 2024

@Quy I guess he is talking about System Links -> Menu Item Alias menu item type when creating menu item.

avatar Quy
Quy - comment - 27 Feb 2024

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.

avatar woluweb
woluweb - comment - 29 Feb 2024

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

  • the question is not how it is filled in (automatically or not)
  • but the question is why even display and save it
avatar brianteeman
brianteeman - comment - 29 Feb 2024

you could tell someone to type in the url or create a link to the url

avatar Hackwar Hackwar - change - 26 Mar 2024
Labels Added: Feature
avatar Hackwar Hackwar - labeled - 26 Mar 2024
avatar rdeutz
rdeutz - comment - 27 Apr 2024

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.

avatar brianteeman
brianteeman - comment - 27 Apr 2024

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

image

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)

avatar uglyeoin
uglyeoin - comment - 27 Apr 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).

avatar rdeutz
rdeutz - comment - 27 Apr 2024

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

avatar brianteeman
brianteeman - comment - 27 Apr 2024

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

avatar brianteeman
brianteeman - comment - 27 Apr 2024

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

avatar uglyeoin
uglyeoin - comment - 27 Apr 2024

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.

avatar brianteeman
brianteeman - comment - 27 Apr 2024

I dont disagree with that and I already said I agree #42811 (comment)

avatar brianteeman
brianteeman - comment - 27 Apr 2024

The change I was against was your suggestion that redirects were used instead

avatar uglyeoin
uglyeoin - comment - 27 Apr 2024

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

avatar rdeutz
rdeutz - comment - 9 May 2024

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.

avatar uglyeoin
uglyeoin - comment - 13 May 2024

Thanks for discussing & feeding back @rdeutz it is appreciated. Feel free to close or merge this "issue".

Add a Comment

Login with GitHub to post a comment