The base class of CMS objects.
A CMS object is a collection of attributes and their values, as defined by its object class. For custom attributes, various attribute types are available.
The base class of CMS objects.
A CMS object is a collection of attributes and their values, as defined by its object class. For custom attributes, various attribute types are available.
Obj
provides the following system attributes to all CMS objects:
Attribute name | Getter | Purpose | Read only | |
---|---|---|---|---|
_id | id() | Unique identifier of a CMS object. Can be specified only on object creation. Use id when searching. | • | |
_contentId | contentId() | [New in 1.22.0]The CMS object content version identifier. | ||
_createdAt | createdAt() | Date of the object’s creation. | • | |
_firstPublishedAt | firstPublishedAt() | Date on which the object was first published. | • | |
_language | language() | [New in 1.22.0]Language of the CMS object. The language code must be in accordance with ISO 639-1, e.g. “fr” or “en-US”. | ||
_lastChanged | lastChanged() | Date of most recent change made to the object. | • | |
_objClass | objClass() | CMS object model class, e.g. “NewsPage”. | ||
_path | path() | Path in the object hierarchy, e.g. “/about/staff” (optional). | ||
_permalink | permalink() | Unique permanent URL component of the object, e.g. “news” (optional). | ||
_publishedAt | publishedAt() | Date of the most recent publish of the object. | • | |
_siteId | siteId() | ID of the website the object belongs to. “default” if the Scrivito CMS doesn’t have multi-site enabled. |
Returns an ObjSearch
of all CMS objects.
Creates a new Obj
with the given attributes
.
Creates a binary Obj
by uploading a file
.
Retrieves the Obj
specified by its id
.
Retrieves the Obj
specified by its path
.
Retrieves the Obj
specified by its permalink
.
Returns a SiteContext
for accessing CMS objects regardless of their site assignment.
Returns a SiteContext
for the site specified by its ID.
Returns the Obj
whose _path
is "/"
.
Returns an ObjSearch
with the given initial subquery based on the specified arguments.
Works like the where query method but can only be used with full-text operators.
Obj
s, from the root
object down to the object’s parent Obj
.Returns the attribute definitions of the corresponding CMS object class.
Returns a list of all Obj
s that link to this Obj
.
Returns an array of all child Obj
s of the CMS object.
The content length (byte size) of a binary CMS object.
The content type of a binary CMS object.
The URL of a binary CMS object.
Creates a copy of the CMS object.
The date the CMS object was created.
Destroys the CMS object in the current working copy.
Returns a promise that is resolved after local changes to the CMS object have been saved.
Returns the date on which the CMS object was first published.
Retrieves the value of the specified custom attribute of the Obj
.
The unique identifier of the Obj
.
Indicates whether the Obj
represents binary data.
Indicates whether or not the Obj
is publicly accessible, i.e. visible to anonymous visitors.
Returns the language of the CMS object.
The date the CMS object was last changed.
The metadata of a binary CMS object.
Returns the modification an Obj
has undergone.
The object class name of the Obj
.
Returns an ordered array of all child Obj
s of the CMS object.
Returns the Obj
representing the path-based parent of the Obj
.
The value of the _path
attribute of the CMS object.
The value of the _permalink
attribute of the CMS object.
Returns the date on which an unmodified CMS object was most recently published.
Restricts the visibility of the Obj
to logged-in visitors.
Returns the site ID of the CMS object.
The slug of the CMS object.
Unrestricts the visibility of the Obj
, i.e. makes it visible to any visitor (after publishing).
Updates one or more attributes of the Obj
.
Updates all references to other CMS objects, based on a mapping function.
Returns an Obj
which is a specific language version of the given CMS object.
Returns all Obj
s that are language versions of the given CMS object, for all sites.
Accesses a widget by its id
.
Returns all the CMS object’s widgets.