Skip to content
Snippets Groups Projects
Commit fab76c70 authored by Eric Bremner's avatar Eric Bremner
Browse files

Updating generic tabs and refactoring multi tab list

parent 896172e9
No related branches found
No related tags found
No related merge requests found
{% for info in lists[type] %}
{% if type == 'Blog' %}
{% include '@components/teaser/teaser--blog/teaser--blog.twig' with {
'title': info.title,
'url': info.url,
'date': info.date,
'author_name': info.author_name,
'author_link': info.author_link,
'sources': info.sources,
'img_element': info.img_element,
'alt': info.alt,
'tags': info.tags,
'content': info.content
} %}
{% endif%}
{% if type == 'News' %}
{% include '@components/teaser/teaser--news/teaser--news.twig' with {
'title': info.title,
'url': info.url,
'date': info.date,
'sources': info.sources,
'img_element': info.img_element,
'alt': info.alt,
'content': info.contnet
} %}
{% endif %}
{% if type == 'Events' %}
{% include '@components/teaser/teaser--event/teaser--event.twig' with {
'title': info.title,
'url': info.url,
'date': info.date,
'sources': info.sources,
'img_element': info.img_element,
'alt': info.alt,
'tags': info.tags,
'content': info.content
} %}
{% endif %}
{% endfor %}
\ No newline at end of file
...@@ -3,56 +3,37 @@ ...@@ -3,56 +3,37 @@
{% set content_list = content_list|merge([type]) %} {% set content_list = content_list|merge([type]) %}
{% endfor %} {% endfor %}
{{ dd(content_list) }}
{% embed '@components/tabs/tabs.twig' with { {% embed '@components/tabs/tabs.twig' with {
'content_list': content_list 'content_list': content_list
} %} } %}
{% for type, list in lists %} {% for type, list in lists %}
{% for info in list %}
{% block content~{{ type }} %}
{% if type == 'Blog' %} {% if loop.parent.loop.index == 1 %}
{% include '@components/teaser/teaser--blog/teaser--blog.twig' with { {% block content_area_1 %}
'title': content.title, {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with {
'url': content.url, 'type': type,
'date': content.date, 'lists': lists
'author_name': content.author_name, } %}
'author_link': content.author_link, {% endblock %}
'sources': content.sources, {% elseif loop.parent.loop.index == 2 %}
'img_element': content.img_element, {% block content_area_2 %}
'alt': content.alt, {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with {
'tags': content.tags, 'type': type,
'content': content.content 'lists': lists
} %} } %}
{% endif%} {% endblock %}
{% elseif loop.parent.loop.index == 3 %}
{% if type == 'News' %} {% block content_area_3 %}
{% include '@components/teaser/teaser--news/teaser--news.twig' with { {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with {
'title': content.title, 'type': type,
'url': content.url, 'lists': lists
'date': content.date, } %}
'sources': content.sources, {% endblock %}
'img_element': content.img_element,
'alt': content.alt,
'content': content.content
} %}
{% endif %}
{% if type == 'Events' %}
{% include '@components/teaser/teaser--event/teaser--event.twig' with {
'title': content.title,
'url': content.url,
'date': content.date,
'sources': content.sources,
'img_element': content.img_element,
'alt': content.alt,
'tags': content.tags,
'content': content.content
} %}
{% endif %} {% endif %}
{% endblock %} {% endfor %}
{% endfor %} {% endfor %}
......
...@@ -251,8 +251,3 @@ lists: ...@@ -251,8 +251,3 @@ lists:
alt: 'Alternative text for blog teaser photo' alt: 'Alternative text for blog teaser photo'
content: |- content: |-
<p>This is the summary, which can contain <abbr title="Hyper Text Markup Language">HTML</abbr> markup. It should be 600 characters or less.Ea sit vide commodo ancillae, pro eu quidam ancillae offendit. Odio ferri officiis an his, sit id causae partiendo accusamus, has discere expetendis ne. Per at wisi homero voluptaria, vis vidit ornatus vituperatoribus no. Labores maiestatis mei ad, cum cu exerci appareat.</p> <p>This is the summary, which can contain <abbr title="Hyper Text Markup Language">HTML</abbr> markup. It should be 600 characters or less.Ea sit vide commodo ancillae, pro eu quidam ancillae offendit. Odio ferri officiis an his, sit id causae partiendo accusamus, has discere expetendis ne. Per at wisi homero voluptaria, vis vidit ornatus vituperatoribus no. Labores maiestatis mei ad, cum cu exerci appareat.</p>
content_list:
- blogs
- events
- news
\ No newline at end of file
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
button button--large {{ modifier_classes }} button button--large {{ modifier_classes }}
{%- endset %} {%- endset %}
{% block something %}
{% endblock %}
<div class="uw-tabs"> <div class="uw-tabs">
<div class="uw-tab" role="tablist" aria-label="Multi-tab-list"> <div class="uw-tab" role="tablist" aria-label="Multi-tab-list">
...@@ -14,9 +16,27 @@ ...@@ -14,9 +16,27 @@
<h2 class="hide-js"> {{ type }}</h2> <h2 class="hide-js"> {{ type }}</h2>
<div id="{{ type }}" class="uw-tabcontent" role="tabpanel" tabindex="0" aria-labelledby="tab-{{ loop.index }}" {% if loop.index > 1 %} hidden {% endif %} > <div id="{{ type }}" class="uw-tabcontent" role="tabpanel" tabindex="0" aria-labelledby="tab-{{ loop.index }}" {% if loop.index > 1 %} hidden {% endif %} >
{% block content-{{ type }} %} {% if loop.index == 1 %}
Content content content {% block content_area_1 %}
Content area 1
{% endblock %} {% endblock %}
{% elseif loop.index == 2 %}
{% block content_area_2 %}
Content area 2
{% endblock %}
{% elseif loop.index == 3 %}
{% block content_area_3 %}
Content area 3
{% endblock %}
{% elseif loop.index == 4 %}
{% block content_area_4 %}
Content area 4
{% endblock %}
{% elseif loop.index == 5 %}
{% block content_area_5 %}
Content area 5
{% endblock %}
{% endif %}
</div> </div>
{% endfor %} {% endfor %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment