Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

This module enables the Layout Paragraphs builder to use templates and libraries from your site's default theme. It allows you to load paragraph templates and integrate theme styles and scripts into the builder for a more consistent editing experience. The module also supports loading additional templates like node teasers and custom blocks.

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

Tracked releases
7
Tracked since
Apr 2026
Latest release
4 months ago
Releases (12 mo)
7 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.4 Stable Apr 9, 2026
1.1.x-dev Dev Apr 8, 2026
1.1.3 Stable Apr 8, 2026
1.0.3 Stable Apr 8, 2026
1.0.2 Stable Apr 8, 2026
1.0.1 Stable Apr 7, 2026
1.0.x-dev Dev Apr 7, 2026