Skip to content

Commit

Permalink
EWPP-2098: Remove usage of ecl_branding in site header templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
22Alexandra committed Jun 3, 2022
1 parent 4fa1781 commit e5bbde2
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 27 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
"@ecl/twig-component-pagination": "3.3.1",
"@ecl/twig-component-radio": "3.3.1",
"@ecl/twig-component-search-form": "3.3.1",
"@ecl/twig-component-site-header-core": "3.3.1",
"@ecl/twig-component-site-header-standardised": "3.3.1",
"@ecl/twig-component-site-header": "3.3.1",
"@ecl/twig-component-skip-link": "3.3.1",
"@ecl/twig-component-social-media-follow": "3.3.1",
"@ecl/twig-component-social-media-share": "3.3.1",
Expand Down
4 changes: 2 additions & 2 deletions templates/blocks/block--oe-search.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* @see ./core/themes/stable/templates/block/block.html.twig
*/
#}
<div class="ecl-site-header-{{ ecl_branding }}__search-container">
<div class="ecl-site-header__search-container">
<a
class="ecl-button ecl-button--ghost ecl-site-header-{{ ecl_branding }}__search-toggle"
class="ecl-button ecl-button--ghost ecl-site-header__search-toggle"
href=""
data-ecl-search-toggle="true"
aria-controls="{{ content['#id'] }}"
Expand Down
8 changes: 4 additions & 4 deletions templates/blocks/block--system-branding-block.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
#}
{% block content %}
<a
class="ecl-link ecl-link--standalone ecl-site-header-{{ ecl_branding }}__logo-link"
class="ecl-link ecl-link--standalone ecl-site-header__logo-link"
href="{{ site_logo_href }}"
aria-label="{{ logo_aria_label }}"
>
{% if ecl_component_library == 'eu' %}
<img
alt="{{ site_logo_alt }}"
title="{{ site_logo_title }}"
class="ecl-site-header-{{ ecl_branding }}__logo-image-mobile"
class="ecl-site-header__logo-image-mobile"
src="{{ ecl_logo_path ~ '/condensed-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg'}}"
/>
<img
alt="{{ site_logo_alt }}"
title="{{ site_logo_title }}"
class="ecl-site-header-{{ ecl_branding }}__logo-image ecl-site-header-{{ ecl_branding }}__logo-image-desktop"
class="ecl-site-header__logo-image ecl-site-header__logo-image-desktop"
src="{{ ecl_logo_path ~ '/standard-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg'}}"
/>
{% else %}
<img
alt="{{ site_logo_alt }}"
title="{{ site_logo_title }}"
class="ecl-site-header-{{ ecl_branding }}__logo-image ecl-site-header-{{ ecl_branding }}__logo-image-desktop"
class="ecl-site-header__logo-image ecl-site-header__logo-image-desktop"
src="{{ ecl_logo_path ~ '/positive/logo-ec--' ~ current_language_id|to_internal_language_id ~ '.svg'}}"
/>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"value" (string) (default: '')
},
...
]
- "ecl_branding" (string) (default: 'core'): "core" or "standardised" template.
].
#}

{# Internal properties #}
Expand All @@ -39,7 +38,6 @@
{% set _code = code|default('') %}
{% set _path = path|default('') %}
{% set _icon_path = icon_path|default('') %}
{% set _ecl_branding = ecl_branding|default('core') %}

{% set _css_class = 'ecl-site-header__selector' %}
{% set _extra_attributes = [] %}
Expand All @@ -66,22 +64,22 @@
{% endif %}

<a
class="ecl-button ecl-button--ghost ecl-site-header-{{ _ecl_branding }}__language-selector"
class="ecl-button ecl-button--ghost ecl-site-header__language-selector"
href="{{ _path }}"
data-ecl-language-selector
aria-controls="language-list-overlay"
aria-expanded="false"
>
<span class="ecl-site-header-{{ _ecl_branding }}__language-icon">
<span class="ecl-site-header__language-icon">
{% include '@ecl-twig/icon' with {
icon: {
path: _icon_path,
name: 'language',
size: 's'
},
extra_classes: 'ecl-site-header-' ~ _ecl_branding ~ '__icon'
extra_classes: 'ecl-site-header__icon'
} only %}
<span class="ecl-site-header-{{ _ecl_branding }}__language-code">{{ _code }}</span>
<span class="ecl-site-header__language-code">{{ _code }}</span>
</span>
{{- _label -}}
</a>
Expand Down
2 changes: 1 addition & 1 deletion templates/form/form--oe-search-search-form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
extra_classes: 'ecl-search-form__button'
} %}
{% set extra_attributes = attributes|to_ecl_attributes|merge([{'name': 'data-ecl-search-form'}]) %}
{% set extra_classes = 'ecl-site-header-' ~ ecl_branding ~ '__search' %}
{% set extra_classes = 'ecl-site-header__search' %}
{% extends '@ecl-twig/search-form' %}
{% block extra_form_elements %}
{{ element.form_build_id }}
Expand Down
8 changes: 4 additions & 4 deletions templates/layout/page--ecl-branding--standardised.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
{% extends "page.html.twig" %}

{% block site_header_container %}
<div class="ecl-site-header-standardised__header">
<div class="ecl-site-header__header">
{{ parent() }}
</div>
{% endblock %}

{% block navigation %}
<div class="ecl-site-header-standardised__banner">
<div class="ecl-site-header__banner">
<div class="ecl-container">
{% if site_name is not empty %}
<div class="ecl-site-header-standardised__site-name">{{ site_name }}</div>
<div class="ecl-site-header__site-name">{{ site_name }}</div>
{% endif %}
{% if cta_link is not empty %}
{% include '@ecl-twig/link' with {
Expand All @@ -31,7 +31,7 @@
icon_position: 'after'
},
icon: get_link_icon(cta_link.path),
extra_classes: 'ecl-standardised__cta',
extra_classes: 'ecl-site-header__cta',
} only %}
{% endif %}
</div>
Expand Down
10 changes: 5 additions & 5 deletions templates/layout/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
{% block site_header %}
{% set has_menu = page.navigation|render|striptags|trim is not empty %}
<header
class="ecl-site-header-{{ ecl_branding }}"
data-ecl-auto-init="SiteHeader{{ ecl_branding|capitalize }}"
class="ecl-site-header"
data-ecl-auto-init="SiteHeader"
{% if has_menu %}data-ecl-has-menu{% endif %}
>
{{ page.site_top_bar }}
{% block site_header_container %}
<div class="ecl-site-header-{{ ecl_branding }}__container ecl-container">
<div class="ecl-site-header-{{ ecl_branding }}__top">
<div class="ecl-site-header__container ecl-container">
<div class="ecl-site-header__top">
{{ page.site_header }}
<div class="ecl-site-header-{{ ecl_branding }}__action">
<div class="ecl-site-header__action">
{{ page.site_header_secondary }}
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions templates/navigation/links--language-block.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
icon_path: ecl_icon_path,
items: languages,
eu_languages: eu_languages,
non_eu_languages: non_eu_languages,
ecl_branding: ecl_branding
non_eu_languages: non_eu_languages
} only %}
{%- endif %}

0 comments on commit e5bbde2

Please sign in to comment.