Sitecore 5.0 API

State.DisableDefaultRenderings Property

Gets or sets a boolean that indicates if the default renderings are disabled or not.

[Visual Basic]
Public Shared Property DisableDefaultRenderings As Boolean
[C#]
public static bool DisableDefaultRenderings {get; set;}

Property Value

True, if default renderings are disabled, otherwise false.

Remarks

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".

Example

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");
    }
  }

See Also

State Class | Sitecore.Configuration Namespace | AddRenderings | RemoveRenderings