Hello,
You can use a modification of the code below to execute your code according to the view mode of the site:
using CMS.CMSHelper;
...
ViewModeEnum currentMode = CMSContext.ViewMode;
switch (currentMode)
{
case ViewModeEnum.Edit:
/*You are in the edit mode*/
break;
case ViewModeEnum.LiveSite:
/*You are in the live site mode*/
break;
}
This can't be used directly in the CMS, however you can simply place the code in a custom transformation
function or into a custom
macro.
Best regards,
Boris Pocatko