Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

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: Organise 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. Organise 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

Activity

Total releases
11
First release
Sep 2025
Latest release
1 week ago
Release cadence
25 days
Stability
91% stable

Release Timeline

Releases

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