[beta3] ⚠️ Header component: split logo field

Created on 8 June 2023, about 1 year ago
Updated 9 June 2023, about 1 year ago

Problem/Motivation

Logo field has this definition:

    logo:
      type: array
      label: Logo text and title

And is used like that in template:

<div class="fr-header__logo">
  <a href="/" title="{{ 'Homepage'|t }}">
    <p class="fr-logo"{% if logo.title %} title="{{ logo.title }}"{% endif %}>
      {% if logo.text %}
        {{ logo.text }}
      {% else %}
        République
        <br>
        Française
      {% endif %}
    </p>
  </a>
</div>

logo.text is a slot (free renderable content) while logo.title is a string prop.
2 different things merged into a single field, this is too opaque, and will cause issue in site building (data mapping to arrays is complicated and error prone)

Proposed resolution

Split logo between logo_text field and logo_title setting.

Data model changes

Yes, this issue is a compatibility breaker.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024