Drupal is a registered trademark of Dries Buytaert
cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). editoria11y 2.2.22 Minor update available for module editoria11y (2.2.22). ai 1.2.13 Minor update available for module ai (1.2.13). ai 1.3.2 Minor update available for module ai (1.3.2). moderated_content_bulk_publish 2.0.51 Minor update available for module moderated_content_bulk_publish (2.0.51). moderated_content_bulk_publish 2.0.50 Minor update available for module moderated_content_bulk_publish (2.0.50). editoria11y 2.2.21 Minor update available for module editoria11y (2.2.21). eca 3.1.0 Minor update available for module eca (3.1.0). sophron 3.1.1 Minor update available for module sophron (3.1.1). ai 1.3.1 Minor update available for module ai (1.3.1). seven 2.0.0-beta6 New beta version released for theme seven (2.0.0-beta6). seven 1.0.1-beta1 First beta version released for theme seven (1.0.1-beta1). layout_paragraphs 3.0.0-beta1 First beta version released for module layout_paragraphs (3.0.0-beta1). raven 7.3.8 Minor update available for module raven (7.3.8). bamboo_twig 6.0.7 Minor update available for module bamboo_twig (6.0.7). ebt_core 1.4.38 Minor update available for module ebt_core (1.4.38). ept_core 1.4.24 Minor update available for module ept_core (1.4.24). block_exclude_pages 2.2.2 Minor update available for module block_exclude_pages (2.2.2).
Layout Paragraphs Theme Extension

This module extends the Layout Paragraphs module to allow loading templates and libraries from the site's default theme directly into the Layout Paragraphs builder.

This is based on the community patch from issue #3208180.

Features

  • Template Loading: Automatically pulls paragraph.html.twig and paragraph--[type].html.twig templates from the default theme to be used in the Layout Paragraphs editor.
  • Additional Templates: Allows specifying extra templates (e.g., node teasers, custom blocks) to be loaded into the builder.
  • Library Integration: Optionally attaches a CSS/JS library from the default theme to the Layout Paragraphs builder UI for better visual consistency between the editor and the front-end.
  • Drupal Compatibility: Supports Drupal 11 and 12.

Installation

  1. Install the module as you would any other Drupal module.
  2. Ensure you have layout_paragraphs and paragraphs modules installed and configured.

Usage

  1. Navigate to Configuration >Content authoring >Layout Paragraphs >Default Theme (/admin/config/content/layout_paragraphs/default-theme).
  2. Display default theme in admin: Check this to enable the extension.
  3. Default theme library: Enter the machine name of a library from your default theme (e.g., mytheme/layout-paragraphs-editor) to load its styles/scripts in the builder.
  4. Additional templates to load: List any extra template machine names (one per line) that you want the builder to respect from the default theme.
  5. Save configuration.
  6. Clear caches for theme registry changes to take effect.

CSS Scoping Example

When loading theme styles into the Layout Paragraphs builder, it's often necessary to scope them so they only apply to the builder interface and don't conflict with the admin theme's own styles.

The Layout Paragraphs builder is wrapped in the .lp-builder class. You can use this to scope your theme's CSS:

// In your theme's editor-specific SCSS file:
.lp-builder:not(.is-navigating) {
  // Import your theme's base styles, variables, and mixins.
  @import "variables";
  @import "typography";
  @import "common";

  // Override some styles to better fit the builder UI.
  .container {
    max-width: 1200px;
    margin: 0 auto;
  }

  .lpb-layout {
    padding: 0;
  }

  // Hide contextual links inside the builder to avoid clutter.
  .contextual {
    display: none;
  }

  // Ensure paragraphs are visible even if they have overflow issues.
  .paragraph--type--layout {
    overflow: visible;
  }

  // Reset font size if the admin theme overrides it.
  .js-lpb-ui {
    font-size: 1rem;
  }
}

Once you have created your editor-specific CSS/SCSS file, you should define it as a library in your theme's *.libraries.yml and then enter that library's machine name (e.g., mytheme/layout-paragraphs-editor) in this module's configuration form.

Technical Details

The module works by altering the theme registry (hook_theme_registry_alter) to point specific paragraph templates to the versions found in the site's default theme, even when viewing the site through an administration theme. It also uses a pre-render callback on the layout_paragraphs_builder element to attach the configured library.

πŸ‡ΊπŸ‡¦

This module is maintained by Ukrainian developers.

Please consider supporting Ukraine in the fight for their freedom and the safety of Europe.

Activity

Total releases
2
First release
Apr 2026
Latest release
19 hours ago
Release cadence
0 days
Stability
50% stable

Releases

Version Type Release date
1.0.1 Stable Apr 7, 2026
1.0.x-dev Dev Apr 7, 2026