3 namespace Drupal\layout_plugin\Annotation;
5 use Drupal\Component\Annotation\Plugin;
8 * Defines a Layout annotation object.
10 * Layouts are used to define a list of regions and then output render arrays
11 * in each of the regions, usually using a template.
13 * Plugin namespace: Plugin\Layout
15 * @see \Drupal\layout_plugin\Plugin\Layout\LayoutInterface
16 * @see \Drupal\layout_plugin\Plugin\Layout\LayoutBase
17 * @see \Drupal\layout_plugin\Plugin\Layout\LayoutPluginManager
22 class Layout extends Plugin {
35 * - full: Layout for the whole page.
36 * - page: Layout for the main page response.
37 * - partial: A partial layout that is typically used for sub-regions.
41 public $type = 'page';
44 * The human-readable name.
46 * @var \Drupal\Core\Annotation\Translation
48 * @ingroup plugin_translatable
53 * An optional description for advanced layouts.
55 * Sometimes layouts are so complex that the name is insufficient to describe
56 * a layout such that a visually impaired administrator could layout a page
57 * for a non-visually impaired audience. If specified, it will provide a
58 * description that is used for accessibility purposes.
60 * @var \Drupal\Core\Annotation\Translation
62 * @ingroup plugin_translatable
67 * The human-readable category.
69 * @var \Drupal\Core\Annotation\Translation
71 * @ingroup plugin_translatable
76 * The theme hook used to render this layout.
78 * If specified, it's assumed that the module or theme registering this layout
79 * will also register the theme hook with hook_theme() itself. This is
80 * mutually exclusive with 'template' - you can't specify both.
82 * @var string optional
89 * The template file to render this layout (relative to the 'path' given).
91 * If specified, then the layout_plugin module will register the template with
92 * hook_theme() and the module or theme registering this layout does not need
93 * to do it. This is mutually exclusive with 'theme' - you can't specify both.
95 * @var string optional
102 * Path (relative to the module or theme) to resources like icon or template.
104 * @var string optional
111 * If specified, it's assumed that the module or theme registering this layout
112 * will also register the library in its *.libraries.yml itself. This is
113 * mutually exclusive with 'css' - you can't specify both.
115 * @var string optional
122 * If specified, then the layout_plugin module will register the library for
123 * this CSS file automatically and the module or theme registering this layout
124 * does not need to do it. This is mutually exclusive with 'library' - you
125 * can't specify both.
127 * @var string optional
129 * @deprecated when moving layout plugin to core
134 * The path to the preview image (relative to the 'path' given).
136 * @var string optional
141 * An associative array of regions in this layout.
143 * The key of the array is the machine name of the region, and the value is
144 * an associative array with the following keys:
145 * - label: (string) The human-readable name of the region.
147 * Any remaining keys may have special meaning for the given layout plugin,
148 * but are undefined here.
152 public $regions = array();