User tests: Successful: Unsuccessful:
Pull Request for Issue # .
By default the showon feature detects the group from base fields. This PR comes to build for developer can specify the field which from the other group.
Eg. I want to show the article title when the value of field jform[attribs][show_title] is show.
Before PR: no way to do (maybe, not sure)
After PR: Article title only show when the show title options is show.
Change the file /administrator/components/com_content/models/forms/article.xml line 21
From
<field
name="title"
type="text"
label="JGLOBAL_TITLE"
description="JFIELD_TITLE_DESC"
class="input-xxlarge input-large-text"
size="40"
required="true"
/>
To
<field
name="title"
type="text"
label="JGLOBAL_TITLE"
description="JFIELD_TITLE_DESC"
class="input-xxlarge input-large-text"
size="40"
required="true"
showon="attribs.show_title:1"
/>
The key changing here is showon="attribs.show_title:1".
The custom group should only apply for the first time, for Eg: we need to expand the condition to show_title is empty OR show_title = 1.
`showon="attribs.show_title:[OR]show_title:1"
`
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Now the show on group is improved overall.
For eg: content title showon attribs.show_title:1[OR]images.float_intro:left
I have tested this item
Test as decribed in first Comment.
@GeraintEdwards can you please retest?
@franz-wohlkoenig If there is not any problem I think it should be RTC.
I have not tested this item.
Du you expect the title field to be bigger than the alias field?
Title |
|
Changed PR title to New Feature
What is missing here for me is that this showon should also consider the global value. I have Global (Show) but the Alias is not shown.
@coolcat-creations as suggested from @GeraintEdwards just like this showon="attribs.show_title:1,"
I have tested this item
Right, sorry - was not obvious to me that it reffered to global :)
Status | Pending | ⇒ | Ready to Commit |
Ready to Commit after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-21 01:08:41 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
?
Removed: ? |
I have tested this item✅ successfully on 66dcdb2
This works fine - a logical extension of showon. I have been grappling with an issue like this for subforms so the idea could be quite useful
By the way you could use
showon="attribs.show_title:1,"
Instead of the more confusing version you have. It basically allows blank or 1 values to match
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18937.