You are here

Site object

The site object provides the following properties and methods.

Properties

sitePreset
A read-only name of the site preset used to create the site
shortName
A read-only unique short name identifying the site
title
The displayable title of the site
description
The displayable description of the site
isPublic
Whether the site is public or not (true or false)
visibility
The visibility of the site (PUBLIC_SITE, MODERATED_SITE, PRIVATE_SITE)
node
The site node (null if there are none)
siteGroup
The site group name
sitePermissionGroups
A map of role name mapped to associated group name

Example

    var site = siteService.getSite("simple-site");

    if(site){
        
        model.sitePreset = site.sitePreset;
        model.shortName = site.shortName;
        model.title = site.title;
        model.description = site.description;
        model.isPublic = site.isPublic;
        model.visibility = site.visibility;
        model.node = site.node;
        model.siteGroup = site.siteGroup;
        model.sitePermissionGroups = site.sitePermissionGroups;
        model.customProperties = site.customProperties;
    }