- Issue created by @brayn7
- Status changed to Closed: outdated
10 months ago 2:22pm 19 January 2024
Compile a list of utility templates we could utilize and implement them. One example of this would be a template that can generate grid items for you. See rough examples.
{% set grid_attributes = create_attribute(grid_attributes|default({})) %}
{% set grid_tag = grid_tag|default('div') %}
{% set cell_attributes = create_attribute(cell_attributes|default({})) %}
{% set cell_tag = cell_tag|default('div') %}
<{{ grid_tag }}{{ grid_attributes }}>
{% if summary %}
{% for item in items['#items'] %}
<{{ cell_tag }}{{ cell_attributes }}>
{{ item }}
</{{ cell_tag }}>
{% endfor %}
{% else %}
{% for i in items['#items']|keys %}
<{{ cell_tag }}{{ cell_attributes }}>
{{ items[i] }}
</{{ cell_tag }}>
{% endfor %}
{% endif %}
</{{ grid_tag }}>
{% set grid_attributes = create_attribute(grid_attributes|default({})) %}
{% set grid_tag = grid_tag|default('div') %}
{% set cell_attributes = create_attribute(cell_attributes|default({})) %}
{% set cell_tag = cell_tag|default('div') %}
<{{ grid_tag }}{{ grid_attributes }}>
{% if summary %}
{% for item in items['#items'] %}
<{{ cell_tag }}{{ cell_attributes }}>
{{ item }}
</{{ cell_tag }}>
{% endfor %}
{% else %}
{% for i in items['#items']|keys %}
<{{ cell_tag }}{{ cell_attributes }}>
{{ items[i] }}
</{{ cell_tag }}>
{% endfor %}
{% endif %}
</{{ grid_tag }}>
{{ attach_library('themekit/organism--key-facts') }}
<div class="organism--key-facts grid-container--narrow no-padding">
{% include '@layout/grid/grid.twig' with {
items: items,
grid_attributes: {'class': ['grid-x', 'grid-margin-y', 'grid-margin-x', 'align-center']},
cell_attributes: {'class': ['cell xsmall-12 medium-4']},
} %}
</div>
Closed: outdated
1.0
Code