Sitecore 5.1.1 API

State.LayoutGroup Property

NOTE: This property is now obsolete.


Gets or sets the current layout group.

[Visual Basic]
Public Shared Property LayoutGroup As String
[C#]
public static string LayoutGroup {get; set;}

Property Value

The name of the current layout group.

Remarks

A layout groups holds a number of different layouts. When the web engine renders a web page at looks at the current layout. If the current layout is a layout group it selects the layout that matches the current value of this State variable.

For instance the State layout group variable may be set to "Print". If the web engine encounters a layout group, it will select the layout matches "Print".

Layout groups can be specified the request query string by specifying "lg=<value>". In this case the scope of the layout group is page only. The "lg" key name can be specified in the Settings.LayoutGroupQSName web.config setting.

When setting the Layout group variable, the request has usually already started and it is too late to change the Layout group as the layout has already be identified. The solution is the redirect to a web page that sets the layout group and then redirect to the original web page. That way the layout group will be set when the request starts.

The scope of the value is session and it is stored in a cookied named "SC_LAYOUTGROUP".

Example

The following example sets the layout group to "Netscape".

  State.LayoutGroup = "Netscape";

See Also

State Class | Sitecore.Configuration Namespace