Preview Content checkbox is not synced with Core Show content preview checkbox

Created on 31 March 2023, over 1 year ago
Updated 20 June 2023, over 1 year ago

Problem/Motivation

Gin LB adds a "Display options" dropdown in secondary toolbar.

This dropdown has a "Preview Content" checkbox which is not synced with the value of Core Layout Builder "Show content preview" option.

Proposed resolution

I tried with adding attributes like Core does in core/modules/layout_builder/src/Form/PreviewToggleTrait.php

    '#attributes' => [
      // Set attribute used by local storage to get content preview status.
      'data-content-preview-id' => 'Drupal.layout_builder.content_preview.' . \Drupal::currentUser()->id(),
    ],

But I think dedicated JS is required to take thi value effectively. As Core JS is tighted to its checkbox ID.

Remaining tasks

Add PHP side and JS side to fix the bug.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

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

Comments & Activities

Production build 0.71.5 2024