SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom Publishing Image field defined as

 <Field ID="{621EC4B5-457F-4B64-B2F1-6F568F6BFA60}" Name="ContentImage1"
 SourceID="" StaticName="ContentImage1" 
 Group="My Custom Columns" DisplayName="ContentImage1" Type="Image" 
 Format="Image" RichText="TRUE" RichTextMode="FullHtml" IsolateStyles="TRUE" 
 Sortable="FALSE" /> 

When using the publishing image field in a page layout it adds extra closing divs which breaks the layout of the page. Weirdly if you then edit the page it fixes it - it fixes the edited page but not the content deployed version of the page (unless you edit it too - which is pointless as it will be overwritten next time the page is deployed)

I've tried using the RichImageField control and the FieldValue control both of which render

<img alt="Learning" height="200" src="/Learn/PublishingImages/theatre880.jpg" 
width="880" style="border:0px solid" /></div></div>

This was proven by wrapping the SharePoint controls in a <span>....</span> and still finding the offending divs in there.

Any ideas?

Is there any way (in a publishing page layout) to get just the url of the image rather than the whole tag?

share|improve this question
up vote 1 down vote accepted

The only way around this is to create a custom control that inherits RichImageField and overrides the rendering (e.g. RenderFieldForDisplay method).

share|improve this answer

Your Answer


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.