[2.0.0-beta3] Test ComponentLayout with layout_paragraphs

Created on 12 September 2024, 7 months ago

Because we generated proper Layout plugins, they must be usable with the popular https://www.drupal.org/project/layout_paragraphs β†’ module (11 000 installs )

But it is better to check

πŸ“Œ Task
Status

Active

Version

2.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

  • Issue created by @pdureau
  • πŸ‡«πŸ‡·France pdureau Paris
  • πŸ‡«πŸ‡·France pdureau Paris
  • πŸ‡«πŸ‡·France G4MBINI BΓ¨gles

    ComponentLayout with layout_paragraphs is working off-the-shelf.

    Tested with UI Suite DaisyUI as follows:

    1. Create a paragraphs called section
    2. Check the Layout Paragraphs behaviour
    3. Pick layouts from all component layouts provided by UI Patterns
    4. Save
    5. Create some classic paragraphs (without checking the Layout Paragraphs behaviour)
    6. Configure the display for each classic paragraphs
    7. Edit Basic page content type
    8. Add a Paragraphs field and check Section paragraphs and classic Paragraphs available for the field
    9. Goto Manage Form Display and choose Layout Paragraphs widget for the Paragraphs field
    10. Goto Manage Display and choose Layout Paragraphs format for the Paragraphs field
    11. Eventually create a Basic Page node
    12. Add a section Paragraphs from one of the layout chosen
    13. Inside each region you can add classic Pargraphs instance

    What could be very kool in the node edit would to have CSS from front loaded inside the Paragraphs field.

    There is an issue about that there : https://www.drupal.org/project/layout_paragraphs/issues/3208180 ✨ Provide frontend editing experience for Layout Paragraphs. Active

  • πŸ‡«πŸ‡·France G4MBINI BΓ¨gles
  • πŸ‡«πŸ‡·France pdureau Paris
  • πŸ‡«πŸ‡·France pdureau Paris

    So, everything is OK on our side.

  • Issue was unassigned.
  • Status changed to Fixed 4 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • πŸ‡«πŸ‡·France pdureau Paris
  • πŸ‡«πŸ‡·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

  • πŸ‡«πŸ‡·France just_like_good_vibes PARIS

    Hello,
    you need to create props to store attributes for each section.
    in the component definition, with $ref: ui-patterns://attributes

    you can then use them in twig

  • πŸ‡«πŸ‡·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?

Production build 0.71.5 2024