Add view mode option

Created on 6 February 2025, 3 months ago

Problem/Motivation

Inline entity forms are selecting entities to render but cannot select which view mode to display.

Proposed resolution

Add view mode option & save to configuration inside InlineEntityFormBase which similar to InlineBlock on layout builder.

   $options = $this->entityDisplayRepository->getViewModeOptionsByBundle('block_content', $block->bundle());
    $element['view_mode'] = [
      '#type' => 'select',
      '#options' => $options,
      '#title' => t('View mode'),
      '#description' => t('The view mode in which to render the block.'),
      '#default_value' => !empty($this->configuration['view_mode']) ? $this->configuration['view_mode'] : '',
      '#access' => count($options) > 1,
      '#weight' => 100
    ];
✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇵🇭Philippines _renify_ cebu

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024