Let's say that I am a developer and I have a module which offers the users several options via a drop-down module. Now suppose that based on the selection I want to give the users another field which is strictly related to the previous choice that the user made. Right now this is not possible and a developer can simply use the manifest XML file to define fields that will be displayed on the settings page no matter what happens. The user cannot see new fields based on actions/decisions he makes.
Here is an example:
Check the screenshot for more details if you don't want to test this with the module I mentioned.
Developers should be able to define actions based on users' selection in the modules' main setting page.
Fields are taken from the manifest XML and they are displayed no matter what happens in terms of user interaction.
CentOS 6
PHP 5.5
MySQL 5.5
More info will be provided if needed.
None
Am I correct in that this is a feature request as opposed to a bug?
Its not a problem to make a feature request @dkanchev I think that with so many people looking at bugs today its sometimes hard to see the wood from the trees
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4759.
Labels |
Added:
?
|
Totally agree :) That's why we clarified that this is a feature request and people will not be confused.
@test I reproduced this on my end as well and agree that without such functionality, the extra field is quite misleading.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4759.
Actually, this is already possible, but I think it's not documented.
Try this in your XML:
<field
name="action_type"
type="list"
label="Select an action"
description=""
default=""
>
<option value="0">Show 404 Not Found error</option>
<option value="1">Show 403 Forbidden error</option>
<option value="2">Redirect to URL</option>
</field>
<field
name="redirect_url"
type="url"
label="Target URL"
description=""
default="http://www.siteground.com"
size="10"
showon="action_type:2"
/>
Notice the showon
attribute on the field you want to hide. The value defines on which field it should trigger and after the colon which values this field should have to show the current field. You can even pass a coma-separated list of values after the colon.
@dkanchev Can you verify that this is what you wanted?
Status | New | ⇒ | Information Required |
@Bakual great information - 10x for sharing. In this case the status of this bug could be changed to "Invalid" and the only thing that should be done is for the documentation to be updated.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4759.
Status | Information Required | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-20 09:03:37 |
Added it to docs: http://docs.joomla.org/Form_field#Showon
Here is the screenshot:
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4759.