A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

add class only in CMS view

Vote:
 

Is there any way to add a class to an element only when the site is viewed in the CMS? I want to hide certain elements on the end user site, but show the content in the CMS so clients can easily edit it.

Thanks!

#131435
Jul 24, 2015 23:27
Vote:
 

You can check in controller action / view if the page is opened in edit mode like this:

if (EPiServer.Editor.PageEditing.PageIsInEditMode)
{
    ... 
}

Hope this helps

#131437
Edited, Jul 25, 2015 0:53
Vote:
 

thanks!

#131464
Jul 27, 2015 21:44
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.