User tests: Successful: Unsuccessful:
In the Joomla Global Configuration we use an showon
attribute to show/hide certain fields based on the state of a "parent" field. You can see this for example with the FTP settings where the settings itself only show when "Enable FTP" is set to "Yes".
This PR takes this feature to the component settings so it can be used by 3rd party extensions as well.
It also changes the animation slightly which was suggested in the original PR #1240 by @beat and will make it slide up and down instead of an instannt toggle.
You can add a showon
attribute to any config field you want to hide. For example in administrator/components/com_banners/config.xml
you add showon="track_impressions:1"
to the "track_clicks" field. So it looks like this:
<field
name="track_clicks"
type="radio"
class="btn-group btn-group-yesno"
default="0"
showon="track_impressions:1"
label="COM_BANNERS_FIELD_TRACKCLICK_LABEL"
description="COM_BANNERS_FIELD_TRACKCLICK_DESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
This will only show the "Track Clicks" settings if the "Track Impressions" is set to "Yes" (which has the value 1
).
Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33196
(Note: is there a particular reason that I can't find the issue in the http://issues.joomla.org/tracker/joomla-cms ? )
@MAT978 I added the tracker item by editing the PR. JIssues doesn't get updated by edits (I think that's how the GitHub API works). But now that you did a comment, it is updated and you should see it.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-01-28 14:24:09 |
Unfortunately, in the last few months something changed with their API so that it isn't triggering update events anymore. So, we're having to work through some growing pains with that change.
Thanks for answering ;)
thank you guys I mean really: MERCI!!!
Ok, I have to change my habits but between the new IssueTracker and the PatchTester, it's a real pleasure!
superb job!
Will this work in any form xm file?
Will this work in any form xm file?
No, it works only in com_config (component settings and global configuration).
I think it should be possible to add it to JForm as well. If someone wants to do it, I'm sure a PR would be welcome.
@test
#2847 works as described following instructions in PR then showon works as expected for component settings.
nice improvement - thanks.
Set RTC since there are 2 successful tests
(Note: is there a particular reason that I can't find the issue in the http://issues.joomla.org/tracker/joomla-cms ? )