bootstrap_italia-8.x-0.x-dev/templates/region/brand/block--system-branding-block.html.twig
templates/region/brand/block--system-branding-block.html.twig
{#
/**
* @file
* Default theme implementation for a branding block.
*
* Each branding element variable (logo, name, slogan) is only available if
* enabled in the block configuration.
*
* Available variables:
* - site_logo: Logo for site as defined in Appearance or theme settings.
* - site_name: Name for site as defined in Site information settings.
* - site_slogan: Slogan for site as defined in Site information settings.
* - link_attributes (obj attribute) (default: '')
*
* @ingroup themeable
*/
#}
{% apply spaceless %}
{% set _link_attributes = link_attributes|default('') %}
{% if _link_attributes is empty %}
{% set link_attributes = create_attribute() %}
{% set link_attributes = link_attributes
.setAttribute('href', path('<front>'))
.setAttribute('title', 'Home'|t)
.setAttribute('rel', 'home')
%}
{% endif %}
<div class="it-brand-wrapper">
<a{{ link_attributes }}>
{% if site_logo %}
{% set check = site_logo %}
{% if not (check ends with '.svg') %}
<img src="{{ site_logo }}" alt="{{ 'Home'|t }}" class="icon{{ image_logo_fluid ? ' img-fluid' }}">
{% else %}
{% set svg_attributes = create_attribute() %}
{% set svg_attributes = svg_attributes.setAttribute('aria-hidden', 'true') %}
{% if svg_logo_box %}
{% set svg_attributes = svg_attributes
.setAttribute('viewBox', svg_logo_box)
%}
{% endif %}
{% if svg_logo_box_sticky %}
{% set svg_attributes = svg_attributes
.setAttribute('data-sticky-viewBox', svg_logo_box_sticky)
%}
{% endif %}
{% include '@bi-bcl/icon/icon.html.twig' with {
name: svg_logo_id ?: 'logo',
icon_path: site_logo,
icon_attributes: svg_attributes
} %}
{% endif %}
{% endif %}
{% block brandText %}
{% if site_name or site_slogan %}
<div class="it-brand-text">
{% if site_name %}
<div class="it-brand-title">{{ site_name }}</div>
{% endif %}
{% if site_slogan %}
<div class="it-brand-tagline d-none d-md-block">{{ site_slogan }}</div>
{% endif %}
</div>
{% endif %}
{% endblock %}
</a>
</div>
{% endapply %}
