templates/homepage-articles/presentation-category.html.twig line 1
{% set introClass = "" %}{% set iconBlock = "" %}{% if block.category_select == "actualites" %}{% set icon = "/resources/img/homepage-icons/actualites-homepage.svg" %}{% set links = sulu_navigation_root_tree('main', 3, true)[0].children %}{% set CTA_link = sulu_navigation_root_tree('main', 3)[0].url %}{% set CTA_title = "Actualités PQN-A" %}{% set introClass = "news-section" %}{% elseif block.category_select == "ressources" %}{% set icon = "/resources/img/homepage-icons/ressources-homepage.svg" %}{% set links = sulu_navigation_root_tree('main', 3, true)[1].children %}{% set CTA_link = sulu_navigation_root_tree('main', 3)[1].url %}{% set CTA_title = "Ressources PQN-A" %}{% set introClass = "resources-section" %}{% elseif block.category_select == "acteur-territoire" %}{% set icon = "/resources/img/homepage-icons/acteur-territoire-homepage.svg" %}{% set links = sulu_navigation_root_tree('main', 3, true)[2].children %}{% set CTA_link = sulu_navigation_root_tree('main', 3)[2].url %}{% set CTA_title = "Acteurs & Territoires PQN-A" %}{% set introClass = "territory-section" %}{% else %}{% set icon = "/resources/img/homepage-icons/qui-sommes-nous-homepage.svg" %}{% set links = sulu_navigation_root_tree('main', 3, true)[3].children %}{% set CTA_link = sulu_navigation_root_tree('main', 3)[3].url %}{% set CTA_title = "Qui sommes-nous ?" %}{% set introClass = "whoarewe-section" %}{% endif %}{% if block.bg_color == "#00747E" %}{% set link_background = "#329B90" %}{% elseif block.bg_color == "#354161" %}{% set link_background = "#495471" %}{% elseif block.bg_color == "#329B90" %}{% set link_background = "#00747E" %}{% elseif block.bg_color == "#605757" %}{% set link_background = "#706868" %}{% endif %}<section class="preview-thematique simple ptb-80px {{ introClass }}"><div class="preview-thematique-header br8 p-{% if block.title_position is defined and block.title_position is not empty %}{{ block.title_position }}{% endif %}"><div class="magic-margin"></div><div class="preview-thematique-title shadow-standard w100 cwhite br8 dflex fdc jcc" {% if block.bg_color %} style="background: {{ block.bg_color }}" {% endif %}><div>{% if icon is defined and icon is not empty %}<img src="{{ icon }}" alt="Icone thematique" loading="lazy" width="80" height="80">{% endif %}{% if block.title %}<h2>{{ block.title }}</h2>{% endif %}{% if block.chapo is defined and block.chapo is not empty %}<p class="lh24">{{ block.chapo }}</p>{% endif %}<ul class="dflex submenu presentation-submenu fwwrap mt-1em {{ block.category_select }}">{% for link in links %}<li>{% set title_class = link.title|lower|slice(0, 12)|replace({"/": "", "-":"", " ": "", "’":"", "'":"","à":"a", "é":"e", "&": ""}) %}<a href="{{ sulu_content_path(link.url) }}" title="{{ link.title }}" class="fw400 nodeco menu-link {{ title_class }}-class prelative cwhite menu-container-icon flex aic" {% if link_background is defined and link_background is not empty %} style="background: {{ link_background }}{% endif %}">{% for child in link.excerpt.icon %}{% set iconBlock = false %}{% if child.url is defined and child.url is not empty %}{% set iconBlock = child.formats['300x']%}<span class="category-icon-display"><img src="{{ iconBlock }}" alt="" width="{{child.fileVersion.properties.width}}" height="{{child.fileVersion.properties.height}}" loading="lazy"></span>{% endif %}{% endfor %}<div>{{ link.title }}</div></a></li>{% endfor %}</ul>{% if CTA_link is defined and CTA_link is not empty %}<a href="{{ CTA_link }}" class="CTA diblock nodeco lh28 ma">{{ CTA_title }}</a>{% endif %}</div></div><div class="preview-thematique-image shadow-standard w100">{% if block.presentation_image is defined and block.presentation_image is not empty %}<img src="{{ block.presentation_image.formats['600x.webp'] }}" srcset="{{ block.presentation_image.formats['300x.webp'] }} 300w, {{ block.presentation_image.formats['600x.webp'] }} 600w, {{ block.presentation_image.formats['1000x.webp'] }} 1000w" sizes="(max-width: 300px) 300w, (max-width: 600px) 600w, 1000w" alt="{{ block.presentation_image | copyright_or_description_or_title }}" class="br8" width="{{ block.presentation_image.fileVersion.properties.width }}" height="{{ block.presentation_image.fileVersion.properties.height }}" loading="lazy">{% endif %}</div></div></section>