1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Creating a child/dependent checkbox in options

Discussion in 'XenForo Development Discussions' started by Brogan, Jan 8, 2012.

  1. Brogan

    Brogan XenForo Moderator Staff Member

    I'm creating a simple add-on which has two checkboxes.
    However, the second is only available if the first checkbox is selected.

    I've been playing around with various things, but can't quite get my head around <sub_options></sub_options>.
    I've looked at the master options.xml file but it's not that helpful.

    Can anyone explain in simple terms how to achieve this?

    Can it be done from within the .xml or does it require an additional options template?

    This is what I have at the moment:
        <group group_id="cta_options" display_order="1" debug_only="0"/>
        <option option_id="cta_option1_active" edit_format="onoff" data_type="boolean" can_backup="1">
            <relation group_id="cta_options" display_order="10"/>
        <option option_id="cta_suboption1_active" edit_format="onoff" data_type="boolean" can_backup="1">
            <relation group_id="cta_options" display_order="20"/>
    I'd like the second "suboption1" to be a child of the first "option1".
    SchmitzIT likes this.
  2. SchmitzIT

    SchmitzIT Well-Known Member

    I'd also like to know this :)
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Thanks to Mike, he has confirmed that an additional template is required.

    Look at the Email Transport Method option for how to specify a template and then examine the template to see how it is defined.

Share This Page