From f5fc031aa49b7641f23f4f9403e39a291af6dea6 Mon Sep 17 00:00:00 2001
From: just_like_good_vibes <mickael@meulle.com>
Date: Mon, 6 Jan 2025 11:38:05 +0100
Subject: [PATCH 1/4] upgrade

---
 components/grid_row/grid_row.component.yml    |  8 ++
 components/grid_row/grid_row.twig             | 10 ++-
 .../grid_row_1/grid_row_1.component.yml       |  8 ++
 components/grid_row_1/grid_row_1.twig         | 10 ++-
 .../grid_row_2/grid_row_2.component.yml       | 16 ++++
 components/grid_row_2/grid_row_2.twig         | 15 +++-
 .../grid_row_3/grid_row_3.component.yml       | 20 +++++
 components/grid_row_3/grid_row_3.twig         | 16 +++-
 .../grid_row_4/grid_row_4.component.yml       | 24 ++++++
 components/grid_row_4/grid_row_4.twig         | 17 ++++-
 templates/system/page.html.twig               | 74 ++++++++++++++-----
 11 files changed, 180 insertions(+), 38 deletions(-)

diff --git a/components/grid_row/grid_row.component.yml b/components/grid_row/grid_row.component.yml
index e16b921..8bef17b 100644
--- a/components/grid_row/grid_row.component.yml
+++ b/components/grid_row/grid_row.component.yml
@@ -84,3 +84,11 @@ props:
       title: "Column offset (extra large)"
       type: integer
       enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+    container_attributes:
+      title: "Container attributes"
+      description: "The attributes to customize the tag with the container class if present."
+      $ref: "ui-patterns://attributes"
+    col_attributes:
+      title: "Column attributes"
+      description: "The attributes to customize the tag with the col class."
+      $ref: "ui-patterns://attributes"
diff --git a/components/grid_row/grid_row.twig b/components/grid_row/grid_row.twig
index e01dd93..cfbf137 100644
--- a/components/grid_row/grid_row.twig
+++ b/components/grid_row/grid_row.twig
@@ -1,10 +1,12 @@
 {% set attributes = attributes.addClass([
+  'fr-grid-row',
   with_gutters ? 'fr-grid-row--gutters',
   horizontal_align ? 'fr-grid-row--' ~ horizontal_align,
   vertical_align ? 'fr-grid-row--' ~ vertical_align,
 ]) %}
 
-{% set col_attributes = create_attribute().addClass([
+{% set col_attributes = create_attribute(col_attributes|default({})).addClass([
+  'fr-col',
   col ? 'fr-col-' ~ col,
   col_sm ? 'fr-col-sm-' ~ col_sm,
   col_md ? 'fr-col-md-' ~ col_md,
@@ -17,16 +19,16 @@
   offset_xl ? 'fr-col-offset-xl-' ~ offset_xl,
 ]) %}
 {% if container_type %}
-{% set container_attributes = create_attribute().addClass([
+{% set container_attributes = create_attribute(container_attributes|default({})).addClass([
   'fr-container',
   (container_type == 'fluid') ? 'fr-container--fluid',
 ]) %}
 <div{{ container_attributes }}>
 {% endif %}
-  <div{{ attributes.addClass('fr-grid-row') }}>
+  <div{{ attributes }}>
     {% set content = content is sequence ? content : [content] %}
     {% for item in content %}
-    <div{{ col_attributes.addClass('fr-col') }}>
+    <div{{ col_attributes }}>
       {{ item }}
     </div>
     {% endfor %}
diff --git a/components/grid_row_1/grid_row_1.component.yml b/components/grid_row_1/grid_row_1.component.yml
index 224e5ba..592c62d 100644
--- a/components/grid_row_1/grid_row_1.component.yml
+++ b/components/grid_row_1/grid_row_1.component.yml
@@ -84,3 +84,11 @@ props:
       title: "Column offset (extra large)"
       type: integer
       enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+    container_attributes:
+      title: "Container attributes"
+      description: "The attributes to customize the tag with the container class if present."
+      $ref: "ui-patterns://attributes"
+    col_attributes:
+      title: "Column attributes"
+      description: "The attributes to customize the tag with the col class."
+      $ref: "ui-patterns://attributes"
diff --git a/components/grid_row_1/grid_row_1.twig b/components/grid_row_1/grid_row_1.twig
index 521d955..5549867 100644
--- a/components/grid_row_1/grid_row_1.twig
+++ b/components/grid_row_1/grid_row_1.twig
@@ -1,10 +1,12 @@
 {% set attributes = attributes.addClass([
+  'fr-grid-row',
   with_gutters ? 'fr-grid-row--gutters',
   horizontal_align ? 'fr-grid-row--' ~ horizontal_align,
   vertical_align ? 'fr-grid-row--' ~ vertical_align,
 ]) %}
 
-{% set col_attributes = create_attribute().addClass([
+{% set col_attributes = create_attribute(col_attributes|default({})).addClass([
+  'fr-col',
   col ? 'fr-col-' ~ col,
   col_sm ? 'fr-col-sm-' ~ col_sm,
   col_md ? 'fr-col-md-' ~ col_md,
@@ -17,14 +19,14 @@
   offset_xl ? 'fr-col-offset-xl-' ~ offset_xl,
 ]) %}
 {% if container_type %}
-{% set container_attributes = create_attribute().addClass([
+{% set container_attributes = create_attribute(container_attributes|default({})).addClass([
   'fr-container',
   (container_type == 'fluid') ? 'fr-container--fluid',
 ]) %}
 <div{{ container_attributes }}>
 {% endif %}
-  <div{{ attributes.addClass('fr-grid-row') }}>
-    <div{{ col_attributes.addClass('fr-col') }}>
+  <div{{ attributes }}>
+    <div{{ col_attributes }}>
       {{ content }}
     </div>
   </div>
diff --git a/components/grid_row_2/grid_row_2.component.yml b/components/grid_row_2/grid_row_2.component.yml
index 20687dc..93f9764 100644
--- a/components/grid_row_2/grid_row_2.component.yml
+++ b/components/grid_row_2/grid_row_2.component.yml
@@ -118,3 +118,19 @@ props:
       items:
         type: integer
         enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+    container_attributes:
+      title: "Container attributes"
+      description: "The attributes to customize the tag with the container class if present."
+      $ref: "ui-patterns://attributes"
+    col_attributes:
+      title: "Column attributes"
+      description: "The attributes to customize the tag with the col class."
+      $ref: "ui-patterns://attributes"
+    first_attributes:
+        title: "First column attributes"
+        description: "The attributes to customize the tag the first column."
+        $ref: "ui-patterns://attributes"
+    second_attributes:
+        title: "Second column attributes"
+        description: "The attributes to customize the tag the second column."
+        $ref: "ui-patterns://attributes"
diff --git a/components/grid_row_2/grid_row_2.twig b/components/grid_row_2/grid_row_2.twig
index 5406ff7..763c505 100644
--- a/components/grid_row_2/grid_row_2.twig
+++ b/components/grid_row_2/grid_row_2.twig
@@ -1,18 +1,25 @@
 {% set attributes = attributes.addClass([
+  'fr-grid-row',
   with_gutters ? 'fr-grid-row--gutters',
   horizontal_align ? 'fr-grid-row--' ~ horizontal_align,
   vertical_align ? 'fr-grid-row--' ~ vertical_align,
 ]) %}
 {% if container_type %}
-{% set container_attributes = create_attribute().addClass([
+{% set container_attributes = create_attribute(container_attributes|default({})).addClass([
   'fr-container',
   (container_type == 'fluid') ? 'fr-container--fluid',
 ]) %}
 <div{{ container_attributes }}>
 {% endif %}
-  <div{{ attributes.addClass('fr-grid-row') }}>
+  <div{{ attributes }}>
+    {% set region_attributes = [
+      create_attribute(first_attributes|default({})),
+      create_attribute(second_attributes|default({})),
+    ] %}
   {% for region in [first, second] %}
-    {% set col_attributes = create_attribute().addClass([
+    {% set col_attributes = create_attribute(col_attributes|default({}))|merge(region_attributes[loop.index0]) %}
+    {% set col_attributes = col_attributes.addClass([
+      'fr-col',
       cols[loop.index0] ? 'fr-col-' ~ cols[loop.index0],
       cols_sm[loop.index0] ? 'fr-col-sm-' ~ cols_sm[loop.index0],
       cols_md[loop.index0] ? 'fr-col-md-' ~ cols_md[loop.index0],
@@ -24,7 +31,7 @@
       offset_lg[loop.index0] ? 'fr-col-offset-lg-' ~ offset_lg[loop.index0],
       offset_xl[loop.index0] ? 'fr-col-offset-xl-' ~ offset_xl[loop.index0],
     ]) %}
-    <div{{ col_attributes.addClass('fr-col') }}>
+    <div{{ col_attributes }}>
       {{ region }}
     </div>
   {% endfor %}
diff --git a/components/grid_row_3/grid_row_3.component.yml b/components/grid_row_3/grid_row_3.component.yml
index 0f99dd3..e3d1628 100644
--- a/components/grid_row_3/grid_row_3.component.yml
+++ b/components/grid_row_3/grid_row_3.component.yml
@@ -121,3 +121,23 @@ props:
       items:
         type: integer
         enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+    container_attributes:
+      title: "Container attributes"
+      description: "The attributes to customize the tag with the container class if present."
+      $ref: "ui-patterns://attributes"
+    col_attributes:
+      title: "Column attributes"
+      description: "The attributes to customize the tag with the col class."
+      $ref: "ui-patterns://attributes"
+    first_attributes:
+        title: "First column attributes"
+        description: "The attributes to customize the tag the first column."
+        $ref: "ui-patterns://attributes"
+    second_attributes:
+        title: "Second column attributes"
+        description: "The attributes to customize the tag the second column."
+        $ref: "ui-patterns://attributes"
+    third_attributes:
+        title: "Third column attributes"
+        description: "The attributes to customize the tag the third column."
+        $ref: "ui-patterns://attributes"
diff --git a/components/grid_row_3/grid_row_3.twig b/components/grid_row_3/grid_row_3.twig
index 9189e1e..72e9e63 100644
--- a/components/grid_row_3/grid_row_3.twig
+++ b/components/grid_row_3/grid_row_3.twig
@@ -1,18 +1,26 @@
 {% set attributes = attributes.addClass([
+  'fr-grid-row',
   with_gutters ? 'fr-grid-row--gutters',
   horizontal_align ? 'fr-grid-row--' ~ horizontal_align,
   vertical_align ? 'fr-grid-row--' ~ vertical_align,
 ]) %}
 {% if container_type %}
-{% set container_attributes = create_attribute().addClass([
+{% set container_attributes = create_attribute(container_attributes|default({})).addClass([
   'fr-container',
   (container_type == 'fluid') ? 'fr-container--fluid',
 ]) %}
 <div{{ container_attributes }}>
 {% endif %}
-  <div{{ attributes.addClass('fr-grid-row') }}>
+  <div{{ attributes }}>
+    {% set region_attributes = [
+      create_attribute(first_attributes|default({})),
+      create_attribute(second_attributes|default({})),
+      create_attribute(third_attributes|default({})),
+    ] %}
   {% for region in [first, second, third] %}
-    {% set col_attributes = create_attribute().addClass([
+    {% set col_attributes = create_attribute(col_attributes|default({}))|merge(region_attributes[loop.index0]) %}
+    {% set col_attributes = col_attributes.addClass([
+      'fr-col',
       cols[loop.index0] ? 'fr-col-' ~ cols[loop.index0],
       cols_sm[loop.index0] ? 'fr-col-sm-' ~ cols_sm[loop.index0],
       cols_md[loop.index0] ? 'fr-col-md-' ~ cols_md[loop.index0],
@@ -24,7 +32,7 @@
       offset_lg[loop.index0] ? 'fr-col-offset-lg-' ~ offset_lg[loop.index0],
       offset_xl[loop.index0] ? 'fr-col-offset-xl-' ~ offset_xl[loop.index0],
     ]) %}
-    <div{{ col_attributes.addClass('fr-col') }}>
+    <div{{ col_attributes }}>
       {{ region }}
     </div>
   {% endfor %}
diff --git a/components/grid_row_4/grid_row_4.component.yml b/components/grid_row_4/grid_row_4.component.yml
index a76e25b..5e31131 100644
--- a/components/grid_row_4/grid_row_4.component.yml
+++ b/components/grid_row_4/grid_row_4.component.yml
@@ -124,3 +124,27 @@ props:
       items:
         type: integer
         enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+    container_attributes:
+      title: "Container attributes"
+      description: "The attributes to customize the tag with the container class if present."
+      $ref: "ui-patterns://attributes"
+    col_attributes:
+      title: "Column attributes"
+      description: "The attributes to customize the tag with the col class."
+      $ref: "ui-patterns://attributes"
+    first_attributes:
+        title: "First column attributes"
+        description: "The attributes to customize the tag the first column."
+        $ref: "ui-patterns://attributes"
+    second_attributes:
+        title: "Second column attributes"
+        description: "The attributes to customize the tag the second column."
+        $ref: "ui-patterns://attributes"
+    third_attributes:
+        title: "Third column attributes"
+        description: "The attributes to customize the tag the third column."
+        $ref: "ui-patterns://attributes"
+    fourth_attributes:
+        title: "Fourth column attributes"
+        description: "The attributes to customize the tag the fourth column."
+        $ref: "ui-patterns://attributes"
diff --git a/components/grid_row_4/grid_row_4.twig b/components/grid_row_4/grid_row_4.twig
index 4332ba4..60942c7 100644
--- a/components/grid_row_4/grid_row_4.twig
+++ b/components/grid_row_4/grid_row_4.twig
@@ -1,18 +1,27 @@
 {% set attributes = attributes.addClass([
+  'fr-grid-row',
   with_gutters ? 'fr-grid-row--gutters',
   horizontal_align ? 'fr-grid-row--' ~ horizontal_align,
   vertical_align ? 'fr-grid-row--' ~ vertical_align,
 ]) %}
 {% if container_type %}
-{% set container_attributes = create_attribute().addClass([
+{% set container_attributes = create_attribute(container_attributes|default({})).addClass([
   'fr-container',
   (container_type == 'fluid') ? 'fr-container--fluid',
 ]) %}
 <div{{ container_attributes }}>
 {% endif %}
-  <div{{ attributes.addClass('fr-grid-row') }}>
+  {% set region_attributes = [
+    create_attribute(first_attributes|default({})),
+    create_attribute(second_attributes|default({})),
+    create_attribute(third_attributes|default({})),
+    create_attribute(fourth_attributes|default({})),
+  ] %}
+  <div{{ attributes }}>
   {% for region in [first, second, third, fourth] %}
-    {% set col_attributes = create_attribute().addClass([
+    {% set col_attributes = create_attribute(col_attributes|default({}))|merge(region_attributes[loop.index0]) %}
+    {% set col_attributes = col_attributes.addClass([
+      'fr-col',
       cols[loop.index0] ? 'fr-col-' ~ cols[loop.index0],
       cols_sm[loop.index0] ? 'fr-col-sm-' ~ cols_sm[loop.index0],
       cols_md[loop.index0] ? 'fr-col-md-' ~ cols_md[loop.index0],
@@ -24,7 +33,7 @@
       offset_lg[loop.index0] ? 'fr-col-offset-lg-' ~ offset_lg[loop.index0],
       offset_xl[loop.index0] ? 'fr-col-offset-xl-' ~ offset_xl[loop.index0],
     ]) %}
-    <div{{ col_attributes.addClass('fr-col') }}>
+    <div{{ col_attributes }}>
       {{ region }}
     </div>
   {% endfor %}
diff --git a/templates/system/page.html.twig b/templates/system/page.html.twig
index cb32cd5..9a83128 100644
--- a/templates/system/page.html.twig
+++ b/templates/system/page.html.twig
@@ -70,24 +70,62 @@
   {{ page.top }}
   <main role="main" class="{{ container }} fr-mb-4w fr-mt-4w">
     <a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
-    <div class="fr-grid-row fr-grid-row--gutters">
-      <div class="fr-col" style="order: 2">
-        {{ page.content }}
-      </div>
-
-      {% if page.sidebar_first %}
-        <aside class="fr-col" role="complementary" style="order: 1">
-          {{ page.sidebar_first }}
-        </aside>
-      {% endif %}
-
-      {% if page.sidebar_second %}
-        <aside class="fr-col" role="complementary" style="order: 3">
-          {{ page.sidebar_second }}
-        </aside>
-      {% endif %}
-    </div>
-
+    {% if page.sidebar_first and page.sidebar_second %}
+      {{ include('ui_suite_dsfr:grid_row_3', {
+          cols: [6, 3, 3],
+          cols_sm: [12, 12, 12],
+          first: page.content,
+          second: page.sidebar_first,
+          third: page.sidebar_second,
+          with_gutters: true,
+          first_attributes: {
+            style: 'order: 2',
+          },
+          second_attributes: {
+            style: 'order: 1',
+            role: 'complementary',
+          },
+          third_attributes: {
+            style: 'order: 3',
+            role: 'complementary',
+          },
+        }, with_context: false) }}
+    {% elseif page.sidebar_first and not page.sidebar_second %}
+      {{ include('ui_suite_dsfr:grid_row_2', {
+          cols: [9, 3],
+          cols_sm: [12, 12],
+          first: page.content,
+          second: page.sidebar_first,
+          with_gutters: true,
+          first_attributes: {
+            style: 'order: 2',
+          },
+          second_attributes: {
+            style: 'order: 1',
+            role: 'complementary',
+          },
+        }, with_context: false) }}
+    {% elseif not page.sidebar_first and page.sidebar_second %}
+      {{ include('ui_suite_dsfr:grid_row_2', {
+          cols: [9, 3],
+          cols_sm: [12, 12],
+          first: page.content,
+          second: page.sidebar_second,
+          with_gutters: true,
+          first_attributes: {
+            style: 'order: 1',
+          },
+          second_attributes: {
+            style: 'order: 2',
+            role: 'complementary',
+          },
+        }, with_context: false) }}
+    {% else %}
+      {{ include('ui_suite_dsfr:grid_row_1', {
+          content: page.content,
+          with_gutters: true,
+        }, with_context: false) }}
+    {% endif %}
   </main>
   {{ page.bottom }}
   {{ include('ui_suite_dsfr:footer', {
-- 
GitLab


From 351dde2eebac5ae1f75743d9419fd5b1751d6126 Mon Sep 17 00:00:00 2001
From: just_like_good_vibes <mickael@meulle.com>
Date: Mon, 6 Jan 2025 12:33:26 +0100
Subject: [PATCH 2/4] fixed way of merging

---
 components/grid_row_2/grid_row_2.twig |  6 +++---
 components/grid_row_3/grid_row_3.twig |  8 ++++----
 components/grid_row_4/grid_row_4.twig | 10 +++++-----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/components/grid_row_2/grid_row_2.twig b/components/grid_row_2/grid_row_2.twig
index 763c505..22ff1e8 100644
--- a/components/grid_row_2/grid_row_2.twig
+++ b/components/grid_row_2/grid_row_2.twig
@@ -13,11 +13,11 @@
 {% endif %}
   <div{{ attributes }}>
     {% set region_attributes = [
-      create_attribute(first_attributes|default({})),
-      create_attribute(second_attributes|default({})),
+      first_attributes|default({}),
+      second_attributes|default({}),
     ] %}
   {% for region in [first, second] %}
-    {% set col_attributes = create_attribute(col_attributes|default({}))|merge(region_attributes[loop.index0]) %}
+    {% set col_attributes = create_attribute(col_attributes|default({})|merge(region_attributes[loop.index0])) %}
     {% set col_attributes = col_attributes.addClass([
       'fr-col',
       cols[loop.index0] ? 'fr-col-' ~ cols[loop.index0],
diff --git a/components/grid_row_3/grid_row_3.twig b/components/grid_row_3/grid_row_3.twig
index 72e9e63..b611876 100644
--- a/components/grid_row_3/grid_row_3.twig
+++ b/components/grid_row_3/grid_row_3.twig
@@ -13,12 +13,12 @@
 {% endif %}
   <div{{ attributes }}>
     {% set region_attributes = [
-      create_attribute(first_attributes|default({})),
-      create_attribute(second_attributes|default({})),
-      create_attribute(third_attributes|default({})),
+      first_attributes|default({}),
+      second_attributes|default({}),
+      third_attributes|default({}),
     ] %}
   {% for region in [first, second, third] %}
-    {% set col_attributes = create_attribute(col_attributes|default({}))|merge(region_attributes[loop.index0]) %}
+    {% set col_attributes = create_attribute(col_attributes|default({})|merge(region_attributes[loop.index0])) %}
     {% set col_attributes = col_attributes.addClass([
       'fr-col',
       cols[loop.index0] ? 'fr-col-' ~ cols[loop.index0],
diff --git a/components/grid_row_4/grid_row_4.twig b/components/grid_row_4/grid_row_4.twig
index 60942c7..e78163c 100644
--- a/components/grid_row_4/grid_row_4.twig
+++ b/components/grid_row_4/grid_row_4.twig
@@ -12,14 +12,14 @@
 <div{{ container_attributes }}>
 {% endif %}
   {% set region_attributes = [
-    create_attribute(first_attributes|default({})),
-    create_attribute(second_attributes|default({})),
-    create_attribute(third_attributes|default({})),
-    create_attribute(fourth_attributes|default({})),
+    first_attributes|default({}),
+    second_attributes|default({}),
+    third_attributes|default({}),
+    fourth_attributes|default({}),
   ] %}
   <div{{ attributes }}>
   {% for region in [first, second, third, fourth] %}
-    {% set col_attributes = create_attribute(col_attributes|default({}))|merge(region_attributes[loop.index0]) %}
+    {% set col_attributes = create_attribute(col_attributes|default({})|merge(region_attributes[loop.index0])) %}
     {% set col_attributes = col_attributes.addClass([
       'fr-col',
       cols[loop.index0] ? 'fr-col-' ~ cols[loop.index0],
-- 
GitLab


From 03817f05555e8e71c92607c2cd8f621d003295be Mon Sep 17 00:00:00 2001
From: just_like_good_vibes <mickael@meulle.com>
Date: Mon, 6 Jan 2025 12:39:42 +0100
Subject: [PATCH 3/4] fixed bug

---
 components/grid_row_2/grid_row_2.twig | 5 ++---
 components/grid_row_3/grid_row_3.twig | 5 ++---
 components/grid_row_4/grid_row_4.twig | 5 ++---
 templates/system/page.html.twig       | 4 ++++
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/components/grid_row_2/grid_row_2.twig b/components/grid_row_2/grid_row_2.twig
index 22ff1e8..d361349 100644
--- a/components/grid_row_2/grid_row_2.twig
+++ b/components/grid_row_2/grid_row_2.twig
@@ -17,8 +17,7 @@
       second_attributes|default({}),
     ] %}
   {% for region in [first, second] %}
-    {% set col_attributes = create_attribute(col_attributes|default({})|merge(region_attributes[loop.index0])) %}
-    {% set col_attributes = col_attributes.addClass([
+    {% set this_col_attributes = create_attribute(col_attributes|default({})|merge(region_attributes[loop.index0])).addClass([
       'fr-col',
       cols[loop.index0] ? 'fr-col-' ~ cols[loop.index0],
       cols_sm[loop.index0] ? 'fr-col-sm-' ~ cols_sm[loop.index0],
@@ -31,7 +30,7 @@
       offset_lg[loop.index0] ? 'fr-col-offset-lg-' ~ offset_lg[loop.index0],
       offset_xl[loop.index0] ? 'fr-col-offset-xl-' ~ offset_xl[loop.index0],
     ]) %}
-    <div{{ col_attributes }}>
+    <div{{ this_col_attributes }}>
       {{ region }}
     </div>
   {% endfor %}
diff --git a/components/grid_row_3/grid_row_3.twig b/components/grid_row_3/grid_row_3.twig
index b611876..b8eecd6 100644
--- a/components/grid_row_3/grid_row_3.twig
+++ b/components/grid_row_3/grid_row_3.twig
@@ -18,8 +18,7 @@
       third_attributes|default({}),
     ] %}
   {% for region in [first, second, third] %}
-    {% set col_attributes = create_attribute(col_attributes|default({})|merge(region_attributes[loop.index0])) %}
-    {% set col_attributes = col_attributes.addClass([
+    {% set this_col_attributes = create_attribute(col_attributes|default({})|merge(region_attributes[loop.index0])).addClass([
       'fr-col',
       cols[loop.index0] ? 'fr-col-' ~ cols[loop.index0],
       cols_sm[loop.index0] ? 'fr-col-sm-' ~ cols_sm[loop.index0],
@@ -32,7 +31,7 @@
       offset_lg[loop.index0] ? 'fr-col-offset-lg-' ~ offset_lg[loop.index0],
       offset_xl[loop.index0] ? 'fr-col-offset-xl-' ~ offset_xl[loop.index0],
     ]) %}
-    <div{{ col_attributes }}>
+    <div{{ this_col_attributes }}>
       {{ region }}
     </div>
   {% endfor %}
diff --git a/components/grid_row_4/grid_row_4.twig b/components/grid_row_4/grid_row_4.twig
index e78163c..68d3d5c 100644
--- a/components/grid_row_4/grid_row_4.twig
+++ b/components/grid_row_4/grid_row_4.twig
@@ -19,8 +19,7 @@
   ] %}
   <div{{ attributes }}>
   {% for region in [first, second, third, fourth] %}
-    {% set col_attributes = create_attribute(col_attributes|default({})|merge(region_attributes[loop.index0])) %}
-    {% set col_attributes = col_attributes.addClass([
+    {% set this_col_attributes = create_attribute(col_attributes|default({})|merge(region_attributes[loop.index0])).addClass([
       'fr-col',
       cols[loop.index0] ? 'fr-col-' ~ cols[loop.index0],
       cols_sm[loop.index0] ? 'fr-col-sm-' ~ cols_sm[loop.index0],
@@ -33,7 +32,7 @@
       offset_lg[loop.index0] ? 'fr-col-offset-lg-' ~ offset_lg[loop.index0],
       offset_xl[loop.index0] ? 'fr-col-offset-xl-' ~ offset_xl[loop.index0],
     ]) %}
-    <div{{ col_attributes }}>
+    <div{{ this_col_attributes }}>
       {{ region }}
     </div>
   {% endfor %}
diff --git a/templates/system/page.html.twig b/templates/system/page.html.twig
index 9a83128..9667515 100644
--- a/templates/system/page.html.twig
+++ b/templates/system/page.html.twig
@@ -74,6 +74,8 @@
       {{ include('ui_suite_dsfr:grid_row_3', {
           cols: [6, 3, 3],
           cols_sm: [12, 12, 12],
+          cols_md: [12, 6, 6],
+          cols_lg: [6, 3, 3],
           first: page.content,
           second: page.sidebar_first,
           third: page.sidebar_second,
@@ -94,6 +96,7 @@
       {{ include('ui_suite_dsfr:grid_row_2', {
           cols: [9, 3],
           cols_sm: [12, 12],
+          cols_lg: [9, 3],
           first: page.content,
           second: page.sidebar_first,
           with_gutters: true,
@@ -109,6 +112,7 @@
       {{ include('ui_suite_dsfr:grid_row_2', {
           cols: [9, 3],
           cols_sm: [12, 12],
+          cols_lg: [9, 3],
           first: page.content,
           second: page.sidebar_second,
           with_gutters: true,
-- 
GitLab


From 595163629a027620cb7797da269f54d08eb9e0c6 Mon Sep 17 00:00:00 2001
From: just_like_good_vibes <mickael@meulle.com>
Date: Mon, 6 Jan 2025 13:13:12 +0100
Subject: [PATCH 4/4] fixed eslint

---
 .../grid_row_2/grid_row_2.component.yml       | 12 +++++-----
 .../grid_row_3/grid_row_3.component.yml       | 18 +++++++-------
 .../grid_row_4/grid_row_4.component.yml       | 24 +++++++++----------
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/components/grid_row_2/grid_row_2.component.yml b/components/grid_row_2/grid_row_2.component.yml
index 93f9764..31abd7e 100644
--- a/components/grid_row_2/grid_row_2.component.yml
+++ b/components/grid_row_2/grid_row_2.component.yml
@@ -127,10 +127,10 @@ props:
       description: "The attributes to customize the tag with the col class."
       $ref: "ui-patterns://attributes"
     first_attributes:
-        title: "First column attributes"
-        description: "The attributes to customize the tag the first column."
-        $ref: "ui-patterns://attributes"
+      title: "First column attributes"
+      description: "The attributes to customize the tag the first column."
+      $ref: "ui-patterns://attributes"
     second_attributes:
-        title: "Second column attributes"
-        description: "The attributes to customize the tag the second column."
-        $ref: "ui-patterns://attributes"
+      title: "Second column attributes"
+      description: "The attributes to customize the tag the second column."
+      $ref: "ui-patterns://attributes"
diff --git a/components/grid_row_3/grid_row_3.component.yml b/components/grid_row_3/grid_row_3.component.yml
index e3d1628..0f1ebfe 100644
--- a/components/grid_row_3/grid_row_3.component.yml
+++ b/components/grid_row_3/grid_row_3.component.yml
@@ -130,14 +130,14 @@ props:
       description: "The attributes to customize the tag with the col class."
       $ref: "ui-patterns://attributes"
     first_attributes:
-        title: "First column attributes"
-        description: "The attributes to customize the tag the first column."
-        $ref: "ui-patterns://attributes"
+      title: "First column attributes"
+      description: "The attributes to customize the tag the first column."
+      $ref: "ui-patterns://attributes"
     second_attributes:
-        title: "Second column attributes"
-        description: "The attributes to customize the tag the second column."
-        $ref: "ui-patterns://attributes"
+      title: "Second column attributes"
+      description: "The attributes to customize the tag the second column."
+      $ref: "ui-patterns://attributes"
     third_attributes:
-        title: "Third column attributes"
-        description: "The attributes to customize the tag the third column."
-        $ref: "ui-patterns://attributes"
+      title: "Third column attributes"
+      description: "The attributes to customize the tag the third column."
+      $ref: "ui-patterns://attributes"
diff --git a/components/grid_row_4/grid_row_4.component.yml b/components/grid_row_4/grid_row_4.component.yml
index 5e31131..9d2e747 100644
--- a/components/grid_row_4/grid_row_4.component.yml
+++ b/components/grid_row_4/grid_row_4.component.yml
@@ -133,18 +133,18 @@ props:
       description: "The attributes to customize the tag with the col class."
       $ref: "ui-patterns://attributes"
     first_attributes:
-        title: "First column attributes"
-        description: "The attributes to customize the tag the first column."
-        $ref: "ui-patterns://attributes"
+      title: "First column attributes"
+      description: "The attributes to customize the tag the first column."
+      $ref: "ui-patterns://attributes"
     second_attributes:
-        title: "Second column attributes"
-        description: "The attributes to customize the tag the second column."
-        $ref: "ui-patterns://attributes"
+      title: "Second column attributes"
+      description: "The attributes to customize the tag the second column."
+      $ref: "ui-patterns://attributes"
     third_attributes:
-        title: "Third column attributes"
-        description: "The attributes to customize the tag the third column."
-        $ref: "ui-patterns://attributes"
+      title: "Third column attributes"
+      description: "The attributes to customize the tag the third column."
+      $ref: "ui-patterns://attributes"
     fourth_attributes:
-        title: "Fourth column attributes"
-        description: "The attributes to customize the tag the fourth column."
-        $ref: "ui-patterns://attributes"
+      title: "Fourth column attributes"
+      description: "The attributes to customize the tag the fourth column."
+      $ref: "ui-patterns://attributes"
-- 
GitLab