You configure how templates are used under the
ibexa.system.<scope>.content_view configuration key.
The following example configuration defines template usage for several cases:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
The content view configuration must be placed under
pagelayout defines the general layout of the whole site.
Other templates can extend the page layout.
ibexa.system.<scope>.content_view configuration key defines rules for rendering content.
Rules are grouped per view type.
1 2 3 4 5 6
The default, built-in views are:
full- used when the Content item is displayed by itself, as a full page
line- used when content is displayed as an item in a list, for example a list of the contents of a folder
text_linked- used for a text section which is a link
embed- used when one Content item is embedded in another, as a block
embed-inline- used when a Content item is embedded inline in another
asset_image- used when an image asset is embedded in another Content item
The built-in views have built-in default templates. You can define any other custom views. For each custom view, you must define a custom template.
Direct path to previewing view types
You can preview content in a specific view type by using a direct path to the built-in view controller:
View rules and matching¶
1 2 3 4 5
template indicates which template to use.
controller indicates which controller and which method to use when rendering the content.
You can use it together with the
template key, or without it.
When you use more than one matcher in one rule, both conditions must match for the rule to apply.
1 2 3
In the example above, content which is either an article or a blog post is matched, but it must be in the "News" Section.
Matching every Content item¶
When you use no matcher in a rule, this rule always match. Several values are available to declare no matcher:
1 2 3
Such rules can be found in the default template configuration.
For example, you can ensure that any Content item lacking a dedicated template isn't displayed in
full view but is instead sent to a custom controller.
1 2 3 4 5 6 7 8 9 10
$view->setResponse((new Response())->setStatusCode(404));, and fetch reverse relations to provide suggestions on the error page.