Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

content (migration step)

Creates, updates, ensures or deletes a content object, with its fields in one or more languages.

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/migration-steps/content.md

On this page

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

KeyTypeModesDefaultWhat it is
classidentifier (class)create, ensurethe class of a new object: its identifier, id or remote:<remote id> (create, ensure)
parentidentifier (node)create, ensurethe parent node of a new object (create, ensure)
objectidentifier (object)update, deletethe object to update or delete (or node:)
nodeidentifier (node)update, deletea node of the object to update or delete (or object:)
remote_idstringcreate, ensurethe remote id of a new object; ensure finds the object by it
languagestringcreate, update, ensurethe language of fields: (default: the default language of content, ContentObjectLocale)
fieldsmapcreate, update, ensureattribute identifier => value, in the language of language:; each value goes through the datatype's fromString()
translationsmapcreate, update, ensurelanguage => a map of fields: one block per further language, each published as a version of its own
sectionidentifier (section)create, ensurethe section of a new object: its identifier or id (default: the parent's)
always_availableboolcreate, ensurewhether a new object is shown in a language it does not have (default: the class's setting)
in_placeboolupdate, ensurefalsetrue: the published version is changed in place, without a new version
missingstring: fail, skipupdate, delete"fail"what happens when the object is not there: fail (the default) or skip
trashbooldeletefalsetrue: the object goes to the trash; false (the default): it is removed for good
workflowsboolallfalsetrue: the workflows of the operation's triggers run, as in the administration (default: they do not)
notifyboolallfalsetrue: 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:

ValueWhat it is
object_idthe id of the object
node_idthe id of its main node
remote_idits remote id
versionits current version
nameits name
paththe url path of its main node (path_identification_string)
createdtrue when the step created the object
changedtrue 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 }

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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x