I've created some controler views where I add some special styles to my controls and I want to disable these extra styles when the "Editing" or "Designing" or "controls" Button is disabled is it possible to get these values in the controller?

Currently I am checking this two options, but here I need to change completly into the preview modus to disable my component background styles.

Sitecore.Context.PageMode.IsNormal && Sitecore.Context.PageMode.IsExperienceEditor

so it would be nice If I could control my implementation with the Editing or Designing or Controls checkbox

enter image description here

  • Your question needs clarification. You mention Code Behind files and Controller Views - these are two quite separate technologies (MVC and Webforms). What is it, specifically, you're asking?
    – Mark Cassidy
    Oct 18 '18 at 11:20
  • @MarkCassidy I've corrected my text above. What I mean was the controller in MVC. Oct 18 '18 at 13:22
  • Which is what I thought. But that only adds to the confusion. You've already listed the code statements that check for these conditions - so what remains as a question? :P
    – Mark Cassidy
    Oct 18 '18 at 13:37

If I understand your question properly, you would have to process this client-side (JavaScript), since Sitecore does not do a full page refresh when you click on one of these checkboxes.

The client-side flags would be:

  • Designing: Sitecore.Speak.Commands.EnableDesigning.isEnabled
  • Editing: Sitecore.Speak.Commands.EnableEditing.isEnabled
  • Controls: Sitecore.Speak.Commands.ShowControls.commandContext.button.attributes.isChecked
  • Field Validation: Sitecore.Speak.Commands.EnableFieldsValidation.isEnabled
  • yes you are right, didn't think about it that I don't get a page reload on these checkboxes and so I can't use any .net code to activate or deactivate :-/ and I'Ve heared about speak but don't know anything about it. But thx. Oct 19 '18 at 6:53

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.