1

pretty sure this is a rhetorical question... but....

Is it possible to use the showon option based on a media field having a file selected?

This is what I'd like: all subsequent form fields hidden unless a media file is selected

<field name="feature_bg" type="media" label="TPL_MODULE_BG_LABEL"></field>
<field name="feature_bg_attachment"
    type="list" 
    default="fixed"
    showon="feature_bg:true" 
    label="TPL_MODULE_BG_ATTACHMENT_LABEL" 
    description="TPL_MODULE_BG_ATTACHMENT_DESC">
        <option value="scroll">TPL_BG_SCROLL</option>
        <option value="fixed">TPL_BG_FIXED</option>
        <option value="parallax">TPL_BG_PARALLAX</option>
</field>
<field name="feature_bg_size"
    type="list" 
    default="cover" 
    showon="feature_bg:true" 
    label="TPL_MODULE_BG_SIZE_LABEL" 
    description="TPL_MODULE_BG_SIZE_DESC">
        <option value="cover">TPL_BG_COVER</option>
        <option value="100% 100%">TPL_BG_100</option>
        <option value="auto">TPL_BG_AUTO</option>
        <option value="contain">TPL_BG_CONTAIN</option>
</field>
<field name="feature_bg_repeat"
    type="list" 
    default="no-repeat" 
    showon="feature_bg:true" 
    label="TPL_MODULE_BG_REPEAT_LABEL" 
    description="TPL_MODULE_BG_REPEAT_DESC">
        <option value="no-repeat">TPL_BG_NO_REPEAT</option>
        <option value="repeat">TPL_BG_REPEAT</option>
        <option value="repeat-x">TPL_BG_REPEAT_X</option>
        <option value="repeat-y">TPL_BG_REPEAT_Y</option>
</field>
<field name="feature_bg_position"
    type="list" 
    default="left top" 
    showon="feature_bg:true" 
    label="TPL_MODULE_BG_POSITION_LABEL" 
    description="TPL_MODULE_BG_POSITION_DESC">
        <option value="left top">TPL_BG_LT</option>
        <option value="left center">TPL_BG_LC</option>
        <option value="left bottom">TPL_BG_LB</option>
        <option value="right top">TPL_BG_RT</option>
        <option value="right center">TPL_BG_RC</option>
        <option value="right bottom">TPL_BG_RB</option>
        <option value="center top">TPL_BG_CT</option>
        <option value="center center">TPL_BG_CC</option>
        <option value="center bottom">TPL_BG_CB</option>
</field>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.