update(attributes)

Updates one or more attributes of the Obj.

Copy
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:

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