url_alias
Creates, ensures or deletes a custom URL alias of a node, a global URL alias or a URL wildcard.
A step of a YAML migration with type: url_alias. The class expMigrationStepUrlAlias (kernel/classes/migration/steps/expmigrationstepurlalias.php) is registered in settings/migration.ini [StepSettings] StepTypeList[url_alias].
Modes
mode: is one of create, ensure, delete; every step names one.
Keys
| Key | Type | Modes | Default | What it is |
|---|---|---|---|---|
path | string | all | the address, from the root (about-us/team); each part is cleaned as the URL transformation of site.ini makes it | |
node | identifier (node) | all | the node the address leads to (create, ensure); delete: the node whose custom addresses go (which: all) | |
destination | string | create, ensure | where a global address leads (a module URL as content/search, or another address); with wildcard: the destination, {1} the text of the first * | |
wildcard | string | all | a URL wildcard instead of an alias: the pattern, * any text (old-news/*) | |
language | string | all | the language of the address (create, ensure: default the default language of content; delete: default every language it has) | |
always_available | bool | create, ensure | false | true: the address works in every language of a siteaccess |
redirect | bool | create, ensure | true | true (the default): the address redirects (301) to where it leads; false: it shows the page at its own address |
below_parent | bool | create, ensure | false | true: path: is placed below the address of the node's parent, as the administration does by default |
which | string: all, selected | delete | all: every custom address of node: (without node: every global address); selected: the address of path: | |
missing | string: fail, skip | delete | "fail" | what happens when the address or wildcard 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 |
|---|---|
path | the address as stored (cleaned), or the pattern of the wildcard |
action | where it leads, as the kernel writes it (eznode:59, module:content/search), or the destination of the wildcard |
node_id | the node it leads to, or null |
removed | how many addresses a delete removed |
created | true when the step made the address or wildcard |
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, urlalias.
Example
- type: url_alias
mode: ensure
path: about-us
node: "path:company/about"
- type: url_alias
mode: ensure
wildcard: "old-news/*"
destination: "news/{1}"Related
Generated by ./console exp:help:examples from settings/migration.ini, kernel/classes/migration/steps/expmigrationstepurlalias.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.