API
Version 7.x > API > Render custom webpart different if editor View modes: 
User avatar
Kentico MVP
Kentico MVP
tfayas-avastonetech - 10/25/2013 10:23:25 AM
   
Render custom webpart different if editor
Searched but could not find the answer, anyone able to point me to the API reference that i can say "if (the widget is being rendered in the editor) then display different"

I have a custom widget that puts a link around an image-text item, but in the editor it's rendering the link, thus when you go to edit it directs you to the link location!

Thanks :)

User avatar
Kentico MVP
Kentico MVP
tfayas-avastonetech - 10/25/2013 10:39:25 AM
   
RE:Render custom webpart different if in editor
Actually, found it out, went into debug to see properties:

PortalManager.ViewMode.ToString() gives the mode. Just set it to
if(this.PortalManager.ViewMode.ToString() != "Edit")

The ViewModes are either Edit, Preview, or i assume Live

Hope this helps someone elese