Deleted question. Had my if-statement brackets in the wrong place. Ugh, I need some caffeine!
Ugh nevermind ... brain isn't away yet and I had the if-statement brackets in the wrong place :(.
You can try to use this http://devnet.kentico.com/docs/8_1/api/html/T_CMS_PortalEngine_ViewModeEnum.htm
switch (CMS.PortalEngine.PortalContext.ViewMode) { case ViewModeEnum.LiveSite: // break; case ViewModeEnum.EditLive: // break; case ViewModeEnum.Preview: // break; }
This is useful to know, thank you!
Please, sign in to be able to submit a new answer.