I am creating a page layout (without the associated html file) for my custom content type. One of the fields in my content type is a URL (Hyperlink or Picture) which should point to an image.

How do I render that field as an image?

My field is this:

  runat="server" />

2 Answers 2


try the following

   <PublishingWebControls:RichImageField FieldName="InteralFieldName" runat="server"/>

You will need to have the following in the top of your page layout.

<%@ Register TagPrefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

When I was trying to discover which one to use, I used SharePoint designer. Deploy what you have to your SharePoint site, Open your Page Layout in SPD and edit in advanced mode, then in the toolbox under Page Fields, you should see your content type fields. By dragging them on the page, you will see how they should be defined.

  • It doesn't work. I tried using the RichImageField, but then when I refresh the page, the page shows error.
    – g45rg34d
    Commented Jan 30, 2014 at 3:23
  • I see you have worked it out now. I was guessing the field type you were using, which is why I also explained using SharePoint designer to help. Commented Jan 30, 2014 at 9:58

I've figured it out. It turns out that when you create site column of type SPFieldUrl, you can specify the SPFieldUrl.DisplayFormat.

This can be done through the UI (Site Settings / Site Columns / Manage Column):

URLField show as picture

And in my page layout I have this:

  runat="server" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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