Gets or sets a boolean that indicates if the default renderings are disabled or not.
True, if default renderings are disabled, otherwise false.
Default renderings are the renderings, specified as part of the current layout. For instance the Home layout may have a Document rendering.
When builing a programatic layout using AddRenderings and RemoveRenderings, it is possible to disable any renderings that the layout specifies.
The scope of the value is page and it stored in the Items variable "SC_DISABLE_DEFAULT_RENDERINGS".
The following example builds a special layout if the user is a VIP.
public void BuildVIPLayout(string user) {
if (user == "VIP") {
State.DisableDefaultRenderings = true;
State.AddRenderings.Add("VIPRendering");
}
}
State Class | Sitecore.Configuration Namespace | AddRenderings | RemoveRenderings