By inserting a menu item (type user login) you have params for 'login redirect url' and 'logout redirect url'. Both are simple text fields.
When inserting a module (type user login) you have the same params.
The difference is: module params are select lists with all available menu items.
This ist incosistent. - See screenshots for details (sorry - german).
I think a better way the solution would be how it is done in the module.
As alternative we could use a combination of both solutions.
First - choosing whether a cusom URL or a available menu item, second the choosen param (form field) appears.
Cheers,
Gerald
Title |
|
Category | ⇒ | UI/UX |
Labels |
Added:
?
|
The issue with B/C will be that currently we store the full URL with that field, and the menuitem field would only store the ItemID. Thus you can't just change the fieldtype. Also when you change that, a user who opens and saves the item without changing anything would loose the redirect URL for sure.
So what we could do is add a new menuitem field with an additional option "- Use Custom URL -". If that one is selected the current field will be shown. If a menuitem is selected in the new field, the existing field can be hidden with showon
.
That approach should be B/C but needs additional checks in code everywhere we check for that redirect URL.
I need a same field for a thrid module, maybe i could make a PR, just need to know the right way:
<field
name="login"
type="menuitem"
disable="separator,alias,heading,url"
label="MOD_LOGIN_FIELD_LOGIN_REDIRECT_URL_LABEL"
description="MOD_LOGIN_FIELD_LOGIN_REDIRECT_URL_DESC" >
<option
value="">JDEFAULT</option>
<option
value="-1">MOD_LOGIN_FIELD_LOGIN_OPTION_CUSTOM</option>
</field>
<field
name="login_custom_url"
type="text"
label="MOD_LOGIN_FIELD_LOGIN_REDIRECT_CUSTOM_URL_LABEL"
description="MOD_LOGIN_FIELD_LOGIN_REDIRECT_CUSTOM_URL_DESC"
class="inputbox"
showon="login:-1" />
Finally this has been resolved by #10249
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 16:35:07 |
Closed_By | ⇒ | brianteeman |
Indeed it looks inconsistent as anyway we should not enter an external url in the menu item field.
We may be able to change the menu item behavior to use the same field type as the module (from text to menuitem) BUT I am not sure this would be B.C.