Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a strange problem I can't seem to find a solution for or why it is even happening.

I have a page layout, in the page layout I have the title in an edit mode panel ...

<!-- Edit Title -->
    <PublishingWebControls:EditModePanel runat=server 
    PageDisplayMode="Edit"><SharePointWebControls:TextField 
    FieldName="Title" runat="server" ID="TitleEdit" /></PublishingWebControls:EditModePanel>

Then I have a display mode panel to wrap it with a H1 tag ...

<!-- Display Title -->
    <PublishingWebControls:EditModePanel runat=server 
    PageDisplayMode="Display"><h1><SharePointWebControls:FieldValue 
    FieldName="Title" runat="server" ID="TitleDisplay" /></h1></PublishingWebControls:EditModePanel>

Everything should be great, but when I view the code this is what I see ...

<!-- Display Title --><div><h1>Sign-up forms</h1></div>

I have no idea what is going on ... Thanks for any help!

share|improve this question
    
What did you expect to see? The Edit Mode-panels are evaluated server side, and the server then generates HTML accordingly and sends to the client –  Robert Lindgren Mar 12 '13 at 7:09

3 Answers 3

To exclude the outer DIVs from the output you should set the property "SuppressTag" on your EditModePanel like:

<!-- Display Title -->
<PublishingWebControls:EditModePanel runat="server" 
PageDisplayMode="Display" SupressTag="True"><h1><SharePointWebControls:FieldValue 
FieldName="Title" runat="server" ID="TitleDisplay" /></h1></PublishingWebControls:EditModePanel>

as stated in the documentation here

share|improve this answer

An editmodepanel is a panel that will show the content for which the PageDisplayMode is set. When you are editing the page the content which have the PageDisplayMode set to "Edit" will be shown. When you're just viewing the page the content which have the pagedisplaymode set to "Display" will be shown. This is great when you for example want to have metadata field that the editor can fill in and you don't want it to be displayed for the ordinary viewer. You can also use the EditModePanel to have different rendering for the same field when viewing or editing.

//M

share|improve this answer
    
Sorry Robert but I unanswered your question because when I tried to use 'supress tags = true' it simply hid the contents of what ever was in the panel. I ment to get back to you with an update along with the reason mentioned. so sorry if I seemed rude :) –  mdumka Apr 4 '13 at 20:49
    
That seems odd since that SupressTag should do the trick, and actually do in my environment! But I do see that runat="server" was missing it's quotes in my code –  Robert Lindgren Apr 5 '13 at 12:59

The edit mode panel allows adding or not the container div element. It is rendered by default, but can be removed using the property:

SuppressTag="True"

In the previous answers there's a Typo - SuppressTag should be with double 'p'

https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.webcontrols.editmodepanel.suppresstag(v=office.14).aspx

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.