[beta6] grid_row component, default value for cols

Created on 21 March 2024, 9 months ago
Updated 6 April 2024, 9 months ago

Two changes are expected in the layout systems.

1. Replace Drupal layouts by DSFR layouts

Problem/Motivation

Today, a site builder have access to 8 layouts (without counting the components exposed as layout plugins).

4 from Drupal:

  • One column (layout_onecol)
  • Two column (layout_twocol_section)
  • Three column (layout_threecol_section)
  • Four column (layout_fourcol_section)

4 from DSFR (ui_suite_dsfr.layouts.yml):

  • dsfr_grid_row_1: Grid row (1 col) [dsfr]"
  • dsfr_grid_row_2: "Grid row (2 cols) [dsfr]"
  • dsfr_grid_row_3: "Grid row (3 cols) [dsfr]"
  • dsfr_grid_row_4: "Grid row (4 cols) [dsfr]"

Proposed resolution

Rename the plugin ID of DSFR layouts with the one from Drupal.
It must be enough for the DSFR layouts to replace the Drupal ones.

Also:

  • Change also the layout labels to remove "DSFR" because there is no need to differnetiate them anymore
  • Change also the wording in grid_row component
  • Important: do a hook update to convert attachement to previous layout plugin ID to the new ones

Other tasks

This change looks nice, but it may a be a bit controversial. Don't hesitate to ask the UI Suite and/or Drupal community: https://drupal.slack.com/archives/C03MFN4D40J

Check the Drupal layout are not used anywhere else and the change is not breaking anything, also in admin pages.

API changes

it is breaking only of the hook update is not working. If it is working well, remove ⚠️ from issue title.

grid_row: default value for cols

Problem/Motivation

A small change loosely related to the former.

If fr_col as no value, the grid_row component renderinf is broken.

Proposed resolution

Add a default value to fr_col in template.

Humble, not tested proposal:
{% set fr_col = fr_col|default("fr-col-3") %}

API changes

Not breaking.

📌 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

Merge Requests

Comments & Activities

Production build 0.71.5 2024