Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

This module provides a template system for creating pages using Mercury Editor, allowing users to select pre-defined layouts and content structures. It also enables editors to save existing page layouts as new reusable templates directly from the editor.

A Drupal module that provides a template system for creating pages with pre-configured layouts and content using Mercury Editor.

Overview

Streamlines page creation by providing pre-defined templates that integrate
with Mercury Editor. Content creators can select templates when creating new
pages, ensuring consistency and reducing setup time. Editors with the right
permissions can also capture any existing page layout as a new reusable
template directly from the editor toolbar.

Features

  • Template Management: Create, edit, delete, and disable page templates via the admin interface
  • Save as Page Template: Capture the current page layout as a reusable template without leaving Mercury Editor
  • Template Groups: Organize templates into labeled, sortable sections in the template selector
  • Within-group ordering: Drag-and-drop reordering of templates inside each group
  • Content Type Integration: Configure templates for specific content types
  • Preview Images: Optional per-template image (PNG, JPEG, or WebP) shown in the template selector
  • YAML Configuration: Define templates using YAML for easy editing and version control
  • Flexible Field Support: Support for any field machine name and structure
  • Nested Paragraphs: Support for complex nested paragraph structures
  • Reference Fields: Resolve entity reference and paragraph references from YAML using lookup keys
  • Region Support: Layout regions for content placement
  • Mercury Editor Integration: Seamless integration with Mercury Editor

Requirements

  • Drupal 10.x or 11.x
  • layout_paragraphs: ^2.1
  • mercury_editor: ^2.0
  • paragraphs: ^1.15

Installation

  composer require drupal/mercury_editor_page_templates
  drush en mercury_editor_page_templates
  

Quick Start

  1. Configure Mercury Editor: Set up content types in Mercury Editor settings
  2. Create Templates: Go to Configuration > Content authoring > Mercury Editor Page Templates and add templates with labels, content types, and paragraph structure
  3. Organize Templates: Use the Groups tab to create labeled sections, then assign templates to groups and drag rows to set their order
  4. Use Templates: When creating content, select from available templates in the template selector
  5. Save from the Editor: With an existing page open in Mercury Editor, click Save as Page Template in the toolbar to capture the current layout as a new or updated template

Save as Page Template

Editors with the Administer Mercury Editor Page Templates permission can
capture any open page as a reusable template from the Mercury Editor toolbar.
The dialog supports three modes:

  • New template: Enter a label, machine ID, optional description and group, then click Save
  • Update existing: If the page was originally created from a template, the dialog offers a one-click Update for that template
  • Confirm overwrite: If the machine ID entered matches an existing template, a confirmation step is shown before overwriting

Paragraph field values, style options, layout sections and regions, and nested
paragraphs are all captured from the live Layout Paragraphs tempstore at save
time.

YAML Template Example

  -
    type: custom_section
    description: 'Main Content Section'
    layout: two_column_75_25
    paragraphs:
      -
        type: content_block
        description: 'Content block with title and body in the first region'
        field_config:
          -
            field_name: field_title
            field_structure:
              value: 'Welcome to Our Site'
          -
            field_name: field_body
            field_structure:
              value: 'This is the main content area.'
              format: full_html
        style_options:
          background_color: 'Light Blue'
          text_alignment: 'Left'
          padding_size: 'Medium'
        region: first
      -
        type: text_block
        description: 'Sidebar text block'
        field_config:
          -
            field_name: body
            field_structure:
              value: 'Sidebar content.'
              format: full_html
        style_options:
          background_color: 'bg-light border-2'
          text_alignment: 'text-center font-bold'
        region: second
  

Troubleshooting

Templates not showing?

  • Ensure the content type is configured in Mercury Editor
  • Check the template is assigned to the correct content type and is not disabled
  • Validate YAML syntax

Save as Page Template button not visible?

  • Ensure the user has the Administer Mercury Editor Page Templates permission
  • Confirm the page is open in Mercury Editor (not the standard node edit form)

YAML errors?

  • Use 2-space indentation
  • Check for missing colons after field names
  • Validate with an online YAML validator

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
12
Tracked since
Sep 2025
Latest release
3 weeks ago
Releases (12 mo)
12 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.10 Stable 10–11 Aug 5, 2026
1.0.9 Stable 10–11 May 22, 2026
1.0.8 Stable 10–11 May 22, 2026
1.0.7 Stable 10–11 Mar 31, 2026
1.0.6 Stable 10–11 Mar 27, 2026
1.0.5 Stable 10–11 Mar 23, 2026
1.0.4 Stable 10–11 Mar 23, 2026
1.0.3 Stable 10–11 Mar 23, 2026
1.0.2 Stable 10–11 Mar 23, 2026
1.0.1 Stable 10–11 Mar 20, 2026
1.0.0 Stable 10–11 Mar 19, 2026
1.0.x-dev Dev 10–11 Sep 12, 2025