Success

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
27 Jan 2014

Overview

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.

Testing

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

avatar Bakual Bakual - open - 27 Jan 2014
avatar MAT978
MAT978 - comment - 28 Jan 2014

@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 ? )

avatar Bakual
Bakual - comment - 28 Jan 2014

(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.

avatar Bakual Bakual - close - 28 Jan 2014
avatar Bakual Bakual - change - 28 Jan 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-01-28 14:24:09
avatar Bakual Bakual - close - 28 Jan 2014
avatar Bakual Bakual - head_ref_deleted - 28 Jan 2014
avatar mbabker
mbabker - comment - 28 Jan 2014

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.

avatar MAT978
MAT978 - comment - 28 Jan 2014

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!

avatar kevincam3
kevincam3 - comment - 4 Feb 2014

Will this work in any form xm file?

avatar Bakual
Bakual - comment - 4 Feb 2014

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.

avatar chivitli
chivitli - comment - 16 Feb 2014

I made a PR which adds it to JForm: #3127

avatar Bakual Bakual - reference | 32a1e73 - 12 May 14

Add a Comment

Login with GitHub to post a comment