_categories-macro

Information

Folder
src/components/patterns/form-contact-support/_categories-macro

Files

Template
// src/components/patterns/form-contact-support/_categories-macro/_categories-macro.twig

{% macro categories_fieldset(categories, topic, visible) %}
<fieldset class="ContactSupport-fieldset" data-topic="{{ topic.label|lower }}_fieldset" {% if not visible %} hidden {%- endif -%}
>
	<legend class="ContactSupport-legend">{{ "form_contact_support.fieldset.categories"|t({
		"@topic": topic.label,
	}) }}</legend>
	<ul class="ContactSupport-options">
		{% for category in categories %}
		{% set category_id = [topic.label, category.name, random()]|join('-') %}
			<li>
				<div class="ContactSupport-option">
					{% include "@elements/form-element/option/option.twig" with {
						classes: ["ContactSupport-radio"],
						checked: category.checked,
						id: category_id|lower,
						name: category.name,
						type: "radio",
						value: category.label|lower,
					} only %}
					<label for="{{ category_id|lower }}">{{ category.label }}</label>
				</div>
			</li>
		{% endfor %}
	</ul>
</fieldset>
{% endmacro %}

Variants

default
Open