NOTE: This property is now obsolete.
Use State.CustomLayout instead
Gets or sets a boolean that indicates if current layout was changed.
True, if the layout has been changed, otherwise false.
This boolean is used with with the State variable CurrentLayout. When CurrentLayout is programatically set, CurrentLayoutChanged is set to true.
The scope of the value is page and it is stored in the Items variable "SC_CURRENT_LAYOUT_CHANGED".
The following example builds a special layout if the user is a special user.
public void BuildVIPLayout(string user) {
if (user == "VIP") {
State.CurrentLayout = "VIP layout";
State.AddRenderings.Add("VIPRendering");
}
}
public void Build() {
bool changed = State.CurrentLayoutChanged; // false
BuildVIPLayout("Employee");
changed = State.CurrentLayoutChanged; // false
BuildVIPLayout("VIP");
changed = State.CurrentLayoutChanged; // true
}
State Class | Sitecore.Configuration Namespace | CurrentLayout