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

Nested checkboxes in Style Properties

Discussion in 'XenForo Development Discussions' started by Brogan, Mar 5, 2014.

  1. Brogan

    Brogan XenForo Moderator Staff Member

    Has anyone looked into this?
    I had a little dabble but there doesn't seem to be an "easy" way of doing it.

    Doing it in Options is fairly easy using a named template and the "Array Sub-Options" field, like so:

    Unchecking "Enable Page" automatically disabled the three nested elements, like this:

    However, Style Properties don't use the same concept.
    So although you can use a named template, there is no array sub-options field.

    I suspect it may be possible doing a completely custom template using standard HTML and class="Disabler", but for what is essentially just a minor UI issue, I'm not sure it's worth it.

    Perhaps that's why I can't find a single example of nested checkboxes in any of the SPs :D
  2. Russ

    Russ Well-Known Member

    @Brogan sorry to bump I was researching on this a bit and came across it :D.

    Can you explain or possibly link some examples of "named template" for the style properties?

    I've never had a need for it but am curious exactly what it's for or capable of.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Unfortunately I was never able to get nested elements working for SP's.
    Well, not as simply as it's done for Options.
    In the end I decided it wasn't worth it.

    As far as named templates in SP's are concerned, I use it for this:


    And then in the template:
    <xen:spinboxunit label="{$property.title}" name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}" min="1" max="20" step="1">
        <xen:hint>{xen:if $debugMode, $property.property_name}</xen:hint>
            <xen:include template="style_property_unit_extra">
                <xen:set var="$reset">{xen:phrase reset}</xen:set>
    I think there are also several core SP's which use named templates.
    Edit: This is one - Enable Animations, Using Multiplier, admin.php?styles/master-style.0/style-properties&group=general
    Russ likes this.
  4. Russ

    Russ Well-Known Member

    Thanks, the end result is I was really looking for the use of dropdowns(with pre-defined fields that I set the values on) and wasn't sure if this was a route I was missing before I made a suggestion.
  5. Cylent1

    Cylent1 Active Member

    @Brogan... Your a hero! This is exactly what I have been looking for.

Share This Page