{{ hiddenInput(name, '') }}

<div id="{{ id }}" class="categoriesfield">
    <ul class="elements structure">
        {% nav category in elements %}
            <li id="{{ id }}-category-{{ category.id }}">
                {% set indent = (category.level - 1) * 35 %}
                <div class="row" style="margin-left: -{{ indent }}px; padding-left: {{ indent }}px;">
                    {%- include "_elements/element" with { element: category, context: 'field' } -%}
                </div>

                {%