Remove Page Layout logic from PreviewPanel

Created on 6 September 2025, 25 days ago

Problem/Motivation

There is some code related to Page Layout sub-module in PreviewPanel:

    // Page layout display need preview. We don't have source for title and
    // content, so let replace it on the fly for preview.
    if (\class_exists('PageLayout') && \str_starts_with($builder_id, PageLayout::getPrefix())) {
      $content_placeholder = '<div class="db-background db-preview-placeholder"><h2>[Page] Content placeholder</h2></div>';
      $title_placeholder = '<div class="db-background db-preview-placeholder"><h1 class="title">[Page] Title placeholder</h1></div>';

      // @todo one pass and placeholder style?
      DisplayBuilderHelpers::findArrayReplaceSource($data, ['source_id' => 'page_title'], ['#markup' => $title_placeholder]);
      DisplayBuilderHelpers::findArrayReplaceSource($data, ['source_id' => 'main_page_content'], ['#markup' => $content_placeholder]);
    }

Proposed resolution

Move the logic elsewhere. Remove it fo not necessary anymore.

📌 Task
Status

Active

Version

1.0

Component

UI/UX/Islands

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024