In a Page component like Header or Footer are not editable,Is there a way that i can hide these component in Experience Editor mode. Or do not load the component at all in Experience Editor.

  • yes check if IsExpEditorMode , then dont load the inner html of header/footer and display a message to author - This content is not editable
    – Abhay Dhar
    Apr 23 '20 at 9:53

You can check if page is opened experience editor mode.

@if (!Sitecore.Context.PageMode.IsExperienceEditor)
  <!-- Header Markup -->

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.