3 namespace Drupal\field_layout\Display;
5 use Drupal\Core\Entity\Display\EntityDisplayInterface;
6 use Drupal\Core\Layout\LayoutInterface;
9 * Provides a common interface for entity displays that have layout.
11 interface EntityDisplayWithLayoutInterface extends EntityDisplayInterface {
14 * Gets the default region.
17 * The default region for this display.
19 public function getDefaultRegion();
22 * Gets the layout plugin ID for this display.
25 * The layout plugin ID.
27 public function getLayoutId();
30 * Gets the layout plugin settings for this display.
33 * The layout plugin settings.
35 public function getLayoutSettings();
38 * Sets the layout plugin ID for this display.
40 * @param string|null $layout_id
41 * Either a valid layout plugin ID, or NULL to remove the layout setting.
42 * @param array $layout_settings
43 * (optional) An array of settings for this layout.
47 public function setLayoutId($layout_id, array $layout_settings = []);
50 * Sets the layout plugin for this display.
52 * @param \Drupal\Core\Layout\LayoutInterface $layout
57 public function setLayout(LayoutInterface $layout);
60 * Gets the layout plugin for this display.
62 * @return \Drupal\Core\Layout\LayoutInterface
65 public function getLayout();
68 * Ensures this entity has a layout.
70 * @param string $default_layout_id
71 * (optional) The layout ID to use as a default. Defaults to
76 public function ensureLayout($default_layout_id = 'layout_onecol');