layout_rule
Creates, updates, ensures or deletes a rule of Exponential Layouts that maps pages to a layout.
A step of a YAML migration with type: layout_rule. The class expMigrationStepLayoutRule (kernel/classes/migration/steps/expmigrationsteplayoutrule.php) is registered in settings/migration.ini [StepSettings] StepTypeList[layout_rule].
Modes
mode: is one of create, update, ensure, delete; every step names one.
Keys
| Key | Type | Modes | Default | What it is |
|---|---|---|---|---|
layout | string | all | required | the identifier of the published layout |
targets | list | all | where the rule applies: a list of { type, value } (path, path_prefix, path_info_prefix, path_regex, node, subtree, route, module, module_view); the rule is found by them | |
conditions | list | create, update, ensure | when it applies: a list of { type, value } (siteaccess, class, query_parameter, route_parameter, time ...) | |
priority | int | create, update, ensure | the higher, the earlier it is tried (a new rule: above every other) | |
enabled | bool | create, update, ensure | whether the rule is used (a new rule: true) | |
which | string: all | delete | all: every rule of the layout, whatever its targets | |
missing | string: fail, skip | all | "fail" | what happens when the layout, the rule or Exponential Layouts is not there: fail (the default) or skip |
Besides these, every step takes the keys of the engine: type, mode, if, references, environments, engines and comment (the file format). A key of type identifier names a node, an object or another part of the installation by id, remote id, path or name (identifiers).
Values for references
references: { <name>: <value> } keeps a value of the step's result as ${ref.<name>} for the steps and migrations after it:
| Value | What it is |
|---|---|
rule_id | the id of the rule (of the first with which: all) |
layout_id | the id of the layout |
created | true when the step created the rule |
changed | true when the step changed something |
Undoing
Some steps of this type undo themselves when their migration is rolled back without down: (the class says which); a migration with any other step of it needs down: or a rollback to its caption.
Caches it touches (cleared after the run): content, template-block.
Example
- type: layout_rule
mode: ensure
layout: landing_page
targets:
- { type: node, value: "remote:landing" }
conditions:
- { type: siteaccess, value: site }
priority: 50Related
Generated by ./console exp:help:examples from settings/migration.ini, kernel/classes/migration/steps/expmigrationsteplayoutrule.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.