kai-jacobsen/kontentblocks

View on GitHub
core/Templating/templates/renderer/tabs.twig

Summary

Maintainability
Test Coverage
<div class='kb-field--tabs ui-tabs ui-widget'>
    <ul class="ui-tabs-nav">
        {# navigation #}
        {% for renderSection in structure %}
            {% if (renderSection.section.getNumberOfVisibleFields() > 0) %}
                <li><a href='#tab-{{ renderSection.section.getSectionId() }}'>{{ renderSection.section.getLabel() }}</a></li>
            {% endif %}
        {% endfor %}
    </ul>
        {# container #}
        {% for renderSection in structure %}
            {% if (renderSection.section.getNumberOfVisibleFields() > 0) %}
                <div id='tab-{{ renderSection.section.getSectionId() }}'>
                    {{ renderSection.renderFields( ) }}
                </div>
            {% else %}
                {{ renderSection.renderFields() }}
            {% endif %}
        {% endfor %}
</div>