Install

Works with Drupal: ^10 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 79.84 KB
MD5: fc0ec6739d9bdc43e2d472f361ed1ea5
SHA-1: 548541ca78efe4d3ac6a4f8db73a453d26135d9d
SHA-256: 8ced7b1c7974bfe52ad8a4ec9f6a510402d1b44f805ecbf7c34af4d3b9dc7893
Download zip 129.75 KB
MD5: 880e503edaf8c496a46bd9400721f898
SHA-1: c14115c7d2468585cabb9565dcc44037c7cd3738
SHA-256: fde06d1f902b5de7066c3683d1f5325966fb9fca1594980e22f2aed7a9496fac

Release notes

Added

  • Save as Page Template: A Save as Page Template button is injected
    into the Mercury Editor toolbar for users with the
    "Administer Mercury Editor Page Templates" permission. Clicking it opens an
    AJAX dialog where the editor can capture the current page layout as a
    reusable me_page_template config entity. The dialog has three modes:
    • Source-template mode: when the page was built from a known template,
      the dialog offers a one-click Update option; the editor can still
      choose Save as new template to branch off a new one.
    • Confirm-update mode: if the entered machine ID matches an existing
      template, a confirmation step is shown before overwriting.
    • Regular mode: a full form for label, machine ID, description, group,
      and content type(s).

    The live Layout Paragraphs tempstore is always re-read at submit time so
    any in-progress edits made after the dialog opened are captured.

  • ParagraphToTemplateSerializer service: serializes a
    LayoutParagraphsLayout into the me_page_template paragraphs YAML
    format, capturing field values, style options, layout sections (including
    regions), and paragraphs nested inside entity reference revision fields.
  • Automated tests: Unit tests for SourceTemplateNodeHelper covering all
    tempstore paths (null UUID, stored value, empty string, non-string, exception
    fallback, delete-on-null) and for ParagraphToTemplateSerializer covering
    layout serialization, nested paragraph fields, style option extraction, and
    YAML sanitization. Kernel tests for TemplateGroupHelper covering group
    resolution, label fallback, enrichment, and template partitioning; for
    SourceTemplateNodeHelper covering tempstore persistence; for
    ParagraphToTemplateSerializer covering field serialization against a real
    Drupal install; and for SaveAsPageTemplateDialogForm covering all three
    form modes and AJAX responses.

Fixed

  • Save as Page Template: The linked template ID is stored in a dedicated
    private tempstore keyed by node UUID so it survives Mercury Editor entity
    serialization. Previously a dynamic property was dropped after save, so
    reopening the dialog did not offer to update a template that had just been
    created.
  • Save as Page Template: Updating a template now re-serializes paragraph
    config from the live Layout Paragraphs tempstore on submit, so edits to
    existing components are saved—not only components that were present when the
    dialog first opened. The save action resolves the layout storage key from the
    Mercury Editor node in tempstore, syncs the layout into that node before
    serializing, and no longer restores a stale paragraphs snapshot on the
    duplicate-ID confirmation step. The toolbar link uses the current storage key
    from the edit form when the dialog is opened.
  • Mercury Editor: Component insert/edit forms now call saveLayout() after
    submit so the Mercury node tempstore stays aligned with Layout Paragraphs
    edits (required for accurate template serialization).
  • Save as Page Template: Nested paragraphs in entity reference fields are now serialized
    with full field config instead of only target_id, so edits to the inner card
    are included when saving or updating a template.
  • Template apply: Nested paragraph references are attached with the entity
    key when building new nodes, because unsaved paragraphs have no revision ID
    yet (using target_id alone produced blank contact us cards).
Created by: luongosb
Created on: 22 May 2026 at 16:58 UTC
Last updated: 22 May 2026 at 16:58 UTC
Bug fixes
New features

Other releases