{% set uniqueClass = 'structureview'~random() %} {# Hide "Add child" menu buttons beyond the max depth #} {% if context == 'index' and source.maxDepth is defined and source.maxDepth %} {% set css %} .{{ uniqueClass }}{% for i in 2 .. source.maxDepth if source.maxDepth >= 2 %} ul{% endfor %} .add { display: none; } {% endset %} {% includeCss css %} {% endif %}