Skip to content

[imp] Adding a short link readonly field in menu item edit#9826

Closed
infograf768 wants to merge 1 commit intojoomla:stagingfrom
infograf768:menuitem_shortlink
Closed

[imp] Adding a short link readonly field in menu item edit#9826
infograf768 wants to merge 1 commit intojoomla:stagingfrom
infograf768:menuitem_shortlink

Conversation

@infograf768
Copy link
Copy Markdown
Member

@infograf768 infograf768 commented Apr 10, 2016

When using a Login menu item, one has to enter an internal URL for the login and logout redirections as the fields are of type text instead of menuitem.

Most often, one needs to redirect to an existing menu item.
This new field in the menu item edit will display the correct short url to copy/paste.
It also may be of use for 3rd party extensions.

Just an info, but a useful one. Works also on a multilingual site by adding the correct lang.

Evidently, this shortlink has to be passed through a JRoute() to be used as should on the site.
This is the case for the Login menu item redirections.

After patch:
screen shot 2016-04-10 at 14 23 40
screen shot 2016-04-10 at 14 44 43

Example of use in a Login Menu item:
screen shot 2016-04-10 at 14 48 17

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-staging labels Apr 10, 2016
@brianteeman
Copy link
Copy Markdown
Contributor

You are saying that the short link is index.php?Itemid=280 but isnt the correct link index.php?option=com_content&view=article&id-53&Itemid=280

Wouldnt it be better all round to make the login redirect a select box like it is in the module


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9826.

@infograf768
Copy link
Copy Markdown
Member Author

You are saying that the short link is index.php?Itemid=280 but isnt the correct link index.php?option=com_content&view=article&id-53&Itemid=280

As the title says, "index.php?Itemid=280" can replace easily the detailed link. Just test for yourself.

Wouldnt it be better all round to make the login redirect a select box like it is in the module

That is an issue and the reason for this PR (as well as for #9724). As it is now it would not be B/C as it is a full link which is saved in the params and not only an itemid.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

While it seems to work, i don't particularly agree with this change.

For me a shortlink is something like https://site.tld/<id-or-some-chars> that is a link for communication purposes or even for micro bloging plataforms (ex: twitter).

Wouldnt it be better all round to make the login redirect a select box like it is in the module

I think so, but it seems can be B/C issues

@infograf768
Copy link
Copy Markdown
Member Author

@andrepereiradasilva

We can evidently replace the word "Short Link" by anything else. But it is this format which is useful.

@infograf768
Copy link
Copy Markdown
Member Author

"Short Internal Link" ?

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

why not just use a placeholder="index.php?Itemid=<menu-id>&lang=<language-tag>" in the login/logout redirect field as a example?

More simpler and less confusing IMHO

@infograf768
Copy link
Copy Markdown
Member Author

we do not want the &lang=<language-tag> for a non multilingual site.
I just proposed this PR to help users. I can live without it.

The best solution that would be B/C is to propose 2 fields in the login menu and force one only to be used, then modify the code to fit depending if it's an itemid or another internal link used.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

yes, i understand that, i'm just saying that in my opinion it can be have the opposite effect and confuse users more.

@brianteeman
Copy link
Copy Markdown
Contributor

Why not just add the itemid onto the existing Link field? I never understood why it wasnt there anyway


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9826.

@infograf768
Copy link
Copy Markdown
Member Author

@brianteeman
It would not help in the multilingual case. But we could add also the lang if in multilingual.
That would not help much in #9724 as the ideal for the login menu item redirection is definitely an itemid.

I will try to work on the double field idea.

@brianteeman
Copy link
Copy Markdown
Contributor

Setting to Needs Review


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9826.

@roland-d
Copy link
Copy Markdown
Contributor

roland-d commented May 7, 2016

@infograf768 I agree with this change but as @brianteeman pointed out we should be using the existing link field. Can you provide an update on this?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9826.

@infograf768 infograf768 closed this May 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants