🇫🇷France @fschaff

Account created on 4 June 2009, almost 16 years ago
#

Recent comments

🇫🇷France fschaff

If it ever helps anyone, no need to define attributes in the props, just add in the twig :

{% set SLOT_NAME_attributes = create_attribute(SLOT_NAME['#attributes'] ?? {}) %}
<div{{ SLOT_NAME_attributes }}>
      {{ SLOT_NAME }}
</div>

I don't know if this is the right method, but it works with layout_paragraphs.

🇫🇷France fschaff

Thanks,
I have now this:

name: Section
description: "Section test"
group: Layouts
slots:
  col_1:
    title: Colonne 1
  col_2:
    title: Colonne 2
props:
  type: object
  properties:
    attributes:
      $ref: ui-patterns://attributes
    col_1_attributes:
      $ref: ui-patterns://attributes
    col_2_attributes:
      $ref: ui-patterns://attributes

and this:

<div{{ attributes.addClass('section') }}>
  <div{{ col_1_attributes.addClass('col_1') }}>
    {{ col_1 }}
  </div>

  <div{{ col_2_attributes.addClass('col_2') }}>
    {{ col_2 }}
  </div>
</div>

But the col_1_attributes and col_2_attributes are empty…
Do I miss something?

🇫🇷France fschaff

Hi,
I'm trying to create a custom layout component available in layout_paragraph.
Starting from something simple :

name: Section
description: "Section test"
group: Layouts
slots:
  col_1:
    title: Colonne 1
  col_2:
    title: Colonne 2

I can't get the attribute classes for the regions
Is there anything I can pass to the twig or configure in the yml?
Thanks

Production build 0.71.5 2024