content
Creates, updates, ensures or deletes a content object, with its fields in one or more languages.
A step of a YAML migration with type: content. The class expMigrationStepContent (kernel/classes/migration/steps/expmigrationstepcontent.php) is registered in settings/migration.ini [StepSettings] StepTypeList[content].
Modes
mode: is one of create, update, ensure, delete; every step names one.
Keys
| Key | Type | Modes | Default | What it is |
|---|---|---|---|---|
class | identifier (class) | create, ensure | the class of a new object: its identifier, id or remote:<remote id> (create, ensure) | |
parent | identifier (node) | create, ensure | the parent node of a new object (create, ensure) | |
object | identifier (object) | update, delete | the object to update or delete (or node:) | |
node | identifier (node) | update, delete | a node of the object to update or delete (or object:) | |
remote_id | string | create, ensure | the remote id of a new object; ensure finds the object by it | |
language | string | create, update, ensure | the language of fields: (default: the default language of content, ContentObjectLocale) | |
fields | map | create, update, ensure | attribute identifier => value, in the language of language:; each value goes through the datatype's fromString() | |
translations | map | create, update, ensure | language => a map of fields: one block per further language, each published as a version of its own | |
section | identifier (section) | create, ensure | the section of a new object: its identifier or id (default: the parent's) | |
always_available | bool | create, ensure | whether a new object is shown in a language it does not have (default: the class's setting) | |
in_place | bool | update, ensure | false | true: the published version is changed in place, without a new version |
missing | string: fail, skip | update, delete | "fail" | what happens when the object is not there: fail (the default) or skip |
trash | bool | delete | false | true: the object goes to the trash; false (the default): it is removed for good |
workflows | bool | all | false | true: the workflows of the operation's triggers run, as in the administration (default: they do not) |
notify | bool | all | false | true: the publish makes a notification event (default: published without notification) |
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 |
|---|---|
object_id | the id of the object |
node_id | the id of its main node |
remote_id | its remote id |
version | its current version |
name | its name |
path | the url path of its main node (path_identification_string) |
created | true when the step created the object |
changed | true when the step changed it (created, updated or deleted) |
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.
Example
- type: content
mode: ensure
class: folder
parent: 2
remote_id: news-folder
fields:
name: News
translations:
ger-DE: { name: Nachrichten }
references: { news: node_id }Related
Generated by ./console exp:help:examples from settings/migration.ini, kernel/classes/migration/steps/expmigrationstepcontent.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.