Hi all. I have several nodes using Drupal Core's "Layout Builder" modules. I'm in the process of moving a site from the staging environment to live. Can I export a node's Layout Builder settings using the Configuration Synchronization? Any help is much appreciated!

Comments

MattBrigade created an issue. See original summary.

timmillwood’s picture

Component: node system » layout_builder.module

Moving this to "layout_builder.module".

I believe entity specific overrides for layout are stored within a field on the entity itself, therefore not exportable as config. One of the menu content entity exporters / replicators / syncers should work though.

tedbow’s picture

#2 is correct.

The defaults for entity displays, from Manage Display are exportable.

For individual node settings, from node/[nid]/layout, the overridden layout is stored in a field so would have move the whole node from environment to environment. You would have to find a contrib module solution for that

dmsmidt’s picture

@MattBrigade, could you give any feedback on this issue? Please let us know if you fixed it and/or understand this is not in the scope of this module.

MattBrigade’s picture

@dmsmidt I didn't have very much luck exporting nodes with custom layout builder layouts. The module Default Content Deploy worked really well to export my content, but unfortunately that module isn't designed to retain Layout Builder settings. I ended up using the Page Manager module as its configurations are exportable. I'm going to revisit this issue come Drupal 8.6 to see if core's Layout Builder feature is mature enough for my needs. I appreciate all your help and advice!

tim.plunkett’s picture

Version: 8.5.5 » 8.7.x-dev
Status: Active » Closed (cannot reproduce)
Issue tags: -Layout Builder

You'd need to export the entity view display's config (think field formatter settings) alongside using DCD to get the overrides to deploy.
If that doesn't work, there's a bug in DCD.

MattBrigade’s picture

Version: 8.7.x-dev » 8.5.5
Status: Closed (cannot reproduce) » Active

I'll have to play around with it some more, but I did look at the DCD node configuration export file and the layout builder field was empty.

rfmarcelino’s picture

This is one of things that I like in Page manager that I would love to also have with the Layout builder. The ability of create a structure (page) that is covered by config manager by itself, it would be a major improvement to Layout builder (IMHO).

rfmarcelino’s picture

You could create a content type for each page you need, but that would be sad :)

tim.plunkett’s picture

Version: 8.5.5 » 8.7.x-dev
Category: Support request » Feature request
Status: Active » Postponed
Related issues: +#2960739: Create a layout builder variant

For now this is a duplicate of #2960739: Create a layout builder variant. There is no plan in place to move Page Manager functionality into core. First we'd need to get it working in Page Manager itself.

I'd shift focus to getting contrib up to par first, and then we can discuss getting it into core.

tim.plunkett’s picture

And to point out: using Page Manager would mean using a non-node entity type. If there is still a desire to force nodes into config via DCD, then file a bug in DCD's queue to figure out why it doesn't work now. The layout builder field is a field type same as any other.

tim.plunkett’s picture

Apparently the layout_builder__layout field is empty when used with Default Content module due to the lack of a normalizer, which would be fixed by #2942975: [PP-1] Expose Layout Builder data to REST and JSON:API

Thanks @sam.mortenson for the tip

gun_dose’s picture

@tim.plunkett, I confirm, patch from that issue works fine for me and solved this problem!

tim.plunkett’s picture

Status: Postponed » Closed (duplicate)

Great, thanks for confirming!

chrisck’s picture

I ran into this issue today, completely forgetting that the node layout builder config would be stored in the node/entity level as part of content. #9 suggested creating a content type for each page, however I think another way to do it would be to store the layout config into the Layout Library module as a saved layout, and selecting "Allow content editors to use stored layouts" in the content type Manage Display. Then in the node, select the saved layout in the dropdown.

I will be testing this today and will report back if it works.

Update: It works.

darkodev’s picture

Thanks @chrisck for the layout library suggestion.

Layout Library solves an issue I was pondering for our D7 migration where we are migrating page_manager pages to layout_builder landing pages. Rather than creating each landing page's layout directly, I can instead create a layout_library entity for each landing page with machine name nid_xxxx (where xxxx is the integer nid). This way layouts are in configuration and I just need to map the layout to the node in migration yml by the nid.

I plan to do the same for taxonomy and block layouts.