Important

You are browsing the documentation for version 3.1 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Page Templates

A page_template is a collection of files that expand the visual presentation for one or more route names.

The page templates configuration file should be placed in the Resources/views/layouts/{theme_name}/config folder and named page_templates.yml, for example DemoBundle/Resources/views/layouts/first_theme/config/page_templates.yml.

The allowed page templates configuration options are the following:

Option

Description

Required

label

Label will be displayed in the page template management UI.

yes

route_name

Route name identifier, used in the path where layout updates stored.

yes

key

Key used in the path where layout updates are stored.

yes

description

Description will be displayed in the page template management UI.

no

screenshot

Screenshot for preview. This will be displayed in the page template management UI.

no

enabled

Enable/Disable page template

no

Example:

 1#DemoBundle/Resources/views/layouts/first_theme/config/page_templates.yml
 2templates:
 3   -
 4       label: Custom page template
 5       description: Custom page template description
 6       route_name: demo_first_route_name
 7       key: custom
 8   -
 9       label: Additional page template
10       description: Additional page template description
11       route_name: demo_first_route_name
12       key: additional
13   -
14       label: Additional page template
15       description: Additional page template description
16       route_name: demo_second_route_name
17       key: additional
18titles:
19   demo_first_route_name: First route name title
20   demo_second_route_name: Second route name title

Note

Be aware that page templates inherit parent themes. To override the existing page template, add the layout update file to the page template path in your child theme. For example, if first_theme is the parent theme of second_theme, put the page template into DemoBundle/Resources/views/layouts/second_theme/demo_first_route_name/page_template/custom/layout.yml.

All page template layout updates should be stored in the Resources/views/layouts/{theme_name}/{route_name}/page_template/{page_template_KEY}/ folder, for example DemoBundle/Resources/views/layouts/first_theme/demo_first_route_name/page_template/custom/layout.yml.