Standard Library by Xon

Add-ons Standard Library by Xon 1.20.1

Register & Get access to index
  • Add is_toggle_set template function and toggle-storage-ex backend for the XF toggle JS.
    The stock is_toggled does not allow setting the default value, while is_toggle_set does.
  • Example of a default collapsed node-list:
PHP:
<xf:js src="sv/lib/storage.js" addon="SV/StandardLib" min="1" />
<xf:set var="$isActive" value="{{ is_toggle_set($forum.node_id, false, 'node-toggle') ? ' is-active' : '' }}"/>
<div class="block block--collapsible-child-nodes">
    <div class="block-container">
        <h3 class="block-minorHeader collapseTrigger collapseTrigger--block {$isActive} "
            data-target=".block--collapsible-child-nodes .block-body"
            data-xf-click="toggle"
            data-xf-init="toggle-storage-ex"
            data-storage-type="cookie"
            data-storage-container="node-toggle"
            data-storage-key="{$forum.node_id}"
            data-default-value="0"
            >{{ phrase('sub_forums') }}</h3>
<div class="block-body toggleTarget {$isActive}">
...
</div
  • Avoid duplicate some join expressions multiple times when using optimized list query add-on
  • XF2.2.10 compat fix for "view template modifications" link not rendering
Back
Top Bottom