Obj.onSite(siteId)

Returns a SiteContext for the site specified by its ID.

Returns a SiteContext for accessing CMS objects belonging to a different site than the current one. Note that Scrivito.Obj only returns objects part of the current site.

Returns

SiteContext – a SiteContext

Examples

onSite can also be invoked on a custom class. The returned site context will additionally restrict returned Obj instances to those belonging to the class, similar to Scrivito.Obj (i.e. for get, all and where).

If an Obj is created using this site context, it belongs to the site of the site context.