Learn how Scrivito CMS can help you deliver amazing digital experiences
See Scrivito CMS in action

update(attributes)

Updates one or more attributes of the Obj.

obj.update({title: 'My new title'});

Note that only the specified attributes are updated. Other attributes of the CMS object are not touched.

Params

  • attributes (Object) - The CMS object attributes to update.

Example

Append a new SectionWidget to the body widgetlist attribute of the current page:

widgetlist = Scrivito.currentPage().get("body"); widget = new (Scrivito.getClass('SectionWidget'))({}); widgetlist.push(widget); Scrivito.currentPage().update({body: widgetlist});

Be aware that setting a permalink with update (as opposed to setting it using the UI’s permalink editor) does not check whether the permalink is already in use.