КОНТРОЛЫ/toggler.md


Исходный код

Twig код

<div class="control-toggler{% if need_expand_icon %} need-expand-icon{% endif %} {{class_name}}" {{ additional_data|raw }}>
	{% for item in items %}
		{% if item.link %}
      <a href="{{item.link}}" class="control-toggler__item {% if item.selected %}control-toggler__item-selected{% endif %} {{item.class_name}} {{item_class_name}}" {{ item.additional_data|raw }} title="{{item.title}}"{% if item.value %} value="{{item.value}}"{% else %} value="{{item.id}}"{% endif %} data-id="{{item.id}}">
        {% if item.icon %}<span class="icon icon-heading icon-{{item.icon}}"></span>{% endif %}
        <span>{{item.title}}</span>
        {% if need_expand_icon %}<span class="icon icon-arrow-down-expand"></span>{% endif %}
        {% if not no_arrow %}<b></b>{% endif %}
      </a>
		{% else %}
			{% if item.value is defined and item.name %}
        <label for="{{item.name}}_{{item.value}}" class="control-toggler__item {% if item.selected %}control-toggler__item-selected{% endif %} {% if loop.first %}first{% endif %} {{item.class_name}} {{item_class_name}}" {{item.additional_data|raw}} data-id="{{item.id}}" data-label="{{item.label}}">
          {% if item.icon %}<span class="icon icon-heading icon-{{item.icon}}"></span>{% endif %}<input type="radio" class="hidden {{ item.class_name }}" id="{{item.name}}_{{item.value}}" {% if item.selected %}checked="checked"{% endif %} name="{{item.name}}" value="{{item.value}}">
          {% if need_expand_icon %}<span class="icon icon-arrow-down-expand"></span>{% endif %}
          {% if not no_arrow %}<b></b>{% endif %}
        </label>
      {% else %}
        <span class="{% if item.selected %}control-toggler__item-selected{% endif %}{% if item.icon and not item.title %} control-toggler__item_icon-only{% endif %} control-toggler__item {{item.class_name}} {{item_class_name}}" name="{{item.name}}" {{ item.additional_data|raw }} title="{{item.title}}" data-id="{{item.id}}">
          {% if item.icon %}<span class="icon icon-heading icon-{{item.icon}}"></span>{% endif %}
          {% if item.icon_hover %}<span class="icon icon-heading icon-heading-hover icon-{{item.icon_hover}}"></span>{% endif %}
          {{item.title}}
          {% if not no_arrow %}<b></b>{% endif %}
        </span>
		  {% endif %}
    {% endif %}
	{% endfor %}
</div>

Ссылка на вики репозиторий