Wednesday, 11 August 2010

Feature Receiver for dispaying Publishing Images as html in a document library

Problem: Publishing images can't be created on a document library however, using a site columns you can add Publishing Images & Publishing Html. However the Fields don't display properly unless you create the content type from the site columns and lastly generate the document library from the content type. I already have data so I need the existing columns to display as a custom list publishing image would work.

Resolution: Create a feature receiver to change the column properties pragmatically. There is a catch in that this only applies if you haven't created the document library off the content type which in turn was created off the site columns. Anyway, attached is a feature receiver scoped at web level look at the customised document library and make the publishing field rich text compliant.