Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Layout builder #27

Open
3 tasks
Tracked by #338
Decipher opened this issue Oct 1, 2020 · 4 comments
Open
3 tasks
Tracked by #338

Add support for Layout builder #27

Decipher opened this issue Oct 1, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@Decipher
Copy link
Member

Decipher commented Oct 1, 2020

Is your feature request related to a problem? Please describe.
As an Editor, I want to create Landing Pages using Layout Builder in the Drupal Admin UI and have them rendered accordingly in the FE

Describe the solution you'd like

  • Add a Layout Builder module/component: DruxtLayoutBuilder
    • Add slots for each section, rendering via a relevant Layout component (e.g., layout_onecol -> DruxtLayoutBuilderLayoutOnecol?)
  • Add support for Layout Builder to the DruxtEntity component?

An example usage might be:

<template>
  <DruxtEntity type="node--page" :uuid="uuid">
    <template #default="{ entity }">
      <DruxtLayoutBuilder :entity="entity" />
    </template>
  </DruxtEntity>
</template>

Or:

<template>
  <DruxtEntity :layout-builder="true" type="node--page" :uuid="uuid" />
</template>

Describe alternatives you've considered

Additional context

Decipher added a commit that referenced this issue Jul 21, 2021
Decipher added a commit that referenced this issue Jul 21, 2021
…2.6.1

Bump node-fetch from 2.6.0 to 2.6.1
Decipher added a commit that referenced this issue Jul 21, 2021
…2.6.1

Bump node-fetch from 2.6.0 to 2.6.1
Decipher added a commit that referenced this issue Jul 21, 2021
[#22] Removed JSON API Deserializer from plugin.
@Decipher
Copy link
Member Author

There's a patch to expose Layout Builder data to the JSON:API in the following issue: https://www.drupal.org/project/drupal/issues/2942975

@Decipher Decipher added the enhancement New feature or request label Oct 11, 2021
@Decipher
Copy link
Member Author

Decipher commented Oct 13, 2021

To add the current WIP Drupal core patch you will need to:

  1. composer require cweagans/composer-patches
  2. Add the following to your composer.json:
        "patches": {
            "drupal/core": {
                "https://www.drupal.org/project/drupal/issues/2942975": "https://www.drupal.org/files/issues/2021-09-10/2942975-layout_builder_rest_e866ee63_reverted_0.patch"
            }
        }
    

Edit: Updated patch

After doing that, you will have access to the Layout Builder data on the DruxtEntity components:

image

@Decipher
Copy link
Member Author

It appears that even with the Drupal core patch that Layout Builder only exposes data to the JSON:API when the Allow each content item to have its layout customized. checkbox is checked, otherwise it's stored as configuration.

image

@Decipher
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant