Craft Themes (3.x)

LayoutBehavior extends Behavior
in package

This behaviour is attached to some Craft elements (CategoryGroup, EntryType, Volume, TagGroup, GlobalSet)

It gives a shorter way to access those element's layouts, and edit displays/blocks urls. $group = \Craft::$app->categories->getGroupById(1); $layout = $group->getLayout('theme-handle');

Table of Contents

$owner  : CategoryGroup|EntryType|Volume|TagGroup|GlobalSet
$type  : string
getEditBlocksUrl()  : string
Get the url to edit blocks for a theme.
getEditDisplaysUrl()  : string|null
Get the url to edit displays for a theme and a view mode.
getLayout()  : LayoutInterface|null
Layout getter

Properties

$owner

public CategoryGroup|EntryType|Volume|TagGroup|GlobalSet $owner

Methods

getEditBlocksUrl()

Get the url to edit blocks for a theme.

public getEditBlocksUrl([ThemeInterface|string|null $theme = null ]) : string

If the theme is null the current theme will be used.

Parameters
$theme : ThemeInterface|string|null = null
Return values
string

getEditDisplaysUrl()

Get the url to edit displays for a theme and a view mode.

public getEditDisplaysUrl([ThemeInterface|string|null $theme = null ][, ViewModeInterface|string|null $viewMode = null ]) : string|null

If the theme is null the current theme will be used.

Parameters
$theme : ThemeInterface|string|null = null
$viewMode : ViewModeInterface|string|null = null
Return values
string|null

Search results