-
-
Save Phoen1x84/93ecaf27b5ec48354e484ee983bdc9a9 to your computer and use it in GitHub Desktop.
Sitecore Detect Page Editor C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Sitecore.Context.PageMode.IsPageEditor) | |
{ | |
// capture all page modes | |
} | |
// detailed page modes which could be handy for different editor types | |
if (Sitecore.Context.PageMode.IsPageEditorEditing) | |
{ | |
// specific if using the experience editor | |
// handy for content editors who only edit content and don't make structural changes to the page | |
} | |
if (Sitecore.Context.PageMode.IsPreview) | |
{ | |
// specific if using the preview mode | |
} | |
if (Sitecore.Context.PageMode.IsPageEditorDesigning) | |
{ | |
// specific if using the design mode | |
// this can be really handy for non-content editors and someone who constructs the page | |
// and need to see all the functionality | |
} | |
if (Sitecore.Content.PageMode.IsPageEditorNavigating) | |
{ | |
// general clicking around the site in page editor mode | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment