A SiteContext
provides access to CMS objects, taking their respective website assignment into account. It can be used to retrieve, search and create CMS objects (see below).
Background
In a multi-site-enabled Scrivito application, every CMS object has a siteId
. A site is the collection of all CMS objects that have the same siteId
.
A multi-site Scrivito application is executed in the context of a specific site, derived from its current browser location. Scrivito.Obj
can be considered the SiteContext
of the current site, meaning that Scrivito.Obj
limits access to CMS objects to this current site.
SiteContext types
SiteContext
, each one with a specific site restriction:Scrivito.Obj.onSite
returns a single-site context.Scrivito.Obj.onAllSites
returns an all-sites context.