Normally on lists and libraries to add a picture you would use a ‘Hyperlink or Picture’ column. That’s all fine and good if you know the URL for the image. Unfortunately though, this column provides no way to upload or select items already sitting in SharePoint. While searching around for a solution to this problem I found that there were a range of different ways people have achieved this including the creation of new field types and custom aspx upload pages.
I knew that this had to be complicating things, after all you see image upload/selection functionality elsewhere in SharePoint 2010 (Rich Text Editor!).
There is, in fact, a column type already in SharePoint called “Publishing Image” which appears to be used in the Page Content Types and their associated Page Layouts. The good thing about this column is that it allows you to select from existing content in SharePoint. It also allows you to specify various attributes relating to the image such as Alt text, width and height.
I will now run through an example to add this Image field type to an Annoucements list.
- Create a new Site Column called and set the type to “Image with formatting and constraints for publishing“
- After selecting an image and uploading it, it will be added to the item and it will actually display when you view the item details.
Clicking this will show the normal upload picture dialog:
This also works in views for the list:
Hope this post is of use to some people, let me know in the comments how you applied this. Big thanks to Arnault Nouvel for putting together the CodePlex project and doing pretty much all the hard work!