Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Rendering of Blocks when in Edit Mode

Vote:
0

Hi Guys

I am using PageEditing.PageIsInEditMode to identify if a block is in edit mode and if it is to display some different HTML, although when i am editing on a Page where i have dragged that block on it still things i am in edit mode so displays the same HTML, is their anyway of identifying if i am editing a block or page ?


Minesh

#90994
Sep 23, 2014 15:40
Vote:
0

This could be distinquished using following snippet:

@using EPiServer.Core
@using EPiServer.Editor
@using EPiServer.Web.Routing
@model SampleBlock

Is page editing - @PageEditing.PageIsInEditMode

Is current block - @(this.ViewContext.RequestContext.GetContentLink() == ((IContent)Model).ContentLink)

#91207
Sep 29, 2014 21:28
* 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.