Nested checkboxes in Style Properties

Paul B

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:
checked.webp

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

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
 
@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.
 
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:
upload_2014-3-22_18-12-25.webp

upload_2014-3-22_18-12-50.webp

And then in the template:
HTML:
<xen:spinboxunit label="{$property.title}" name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}" min="1" max="20" step="1">
    <xen:explain>{$property.description}</xen:explain>
    <xen:hint>{xen:if $debugMode, $property.property_name}</xen:hint>

    <xen:html>
        <xen:include template="style_property_unit_extra">
            <xen:set var="$reset">{xen:phrase reset}</xen:set>
        </xen:include>
    </xen:html>

</xen:spinboxunit>

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
 
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.
 
Back
Top Bottom