{% set classes = [ 'paragraph', 'paragraph--type--' ~ paragraph.bundle|clean_class, view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class, not paragraph.isPublished() ? 'paragraph--unpublished', 'widget', 'widget-news-content', ] %} {% block paragraph %} {% block content %} {{ content.controls }} {{ content.insert_before }}
{% if paragraph.field_wg_news_tag.0.target_id is empty %} {% if paragraph.field_wg_title.0 is not empty %}

{{ paragraph.field_wg_title.0.value }}{{ paragraph.field_wg_subtitle.0.value }}

{% set term_depth = 0 %} {% endif %} {% endif %}
{# Level 1 : Tabs #} {% if paragraph.field_wg_news_tag.0.target_id is empty %} {% endif %} {# Level 2 : Ribbon #} {% if paragraph.field_wg_news_tag.0.target_id is not empty %}
{% endif %}
{% if paragraph.field_wg_news_tag.0.target_id is not empty %}

{{ paragraph.field_wg_title.0.value }}{{ paragraph.field_wg_subtitle.0.value }}

{% endif %} {% if paragraph.field_wg_news_show_sub_tags %} {% if term_depth == 0 %} {% for news_tag in top_news_tags %}
    {% set news_sub_tags = level1_news_tags[news_tag.tid] %} {% if news_sub_tags %}
  • All
  • {% endif %} {% for news_sub_tag in news_sub_tags %}
  • {{ news_sub_tag.name }}
  • {% endfor %}
{% endfor %} {% else %}
    {% set news_sub_tags = level1_news_tags[paragraph.field_wg_news_tag.0.target_id] %} {% if news_sub_tags %}
  • All
  • {% endif %} {% for news_sub_tag in news_sub_tags %}
  • {{ news_sub_tag.name }}
  • {% endfor %}
{% endif %} {% endif %}
{% if paragraph.field_wg_news_tag.0.target_id is not empty %}
{% endif %}
{{ content.insert_after }} {% endblock %} {% endblock paragraph %}