Monday, May 16, 2011

Add Multiline Rich Text/Enhanced Rich Text column to document library or picture library

As you might have noticed the by default multiline column type doesn’t support Rich Text or Enhanced Rich text capability for a document/picture library.

There are multiple way to get this feature enabled. First is changing the SQL table for that column which is quick but not recommended and second one is a few step solution which works great without breaking any Microsoft rules.
Lets get started with the steps.
Step 1 – Create a new Site Column
To create a new multiline rich text column, click on Site Actions > Site Settings > Site Columns, then click on Create to add new site column:

Under “Additional Custom Settings”, you can select Rich text or Enhanced rich text option.
Step 2 – Create custom content type
Now we got the rich text site column, next step is to create a custom content type and add this column to it. To do that, click on Site Actions > Site Settings > Site Content Types, then click on Create link to add new content type:

You can give it any name and select the parent content type, for example “Document Content Type” and “Document”.
Click OK to save it.
Step 3 – Add custom site column to content type
Add the custom site column we created “RichtextColumn” to this content type:

Step 4 – Create document library with custom content type
Create a new dummy document library and go to Library Settings > Advanced Settings. Under first section “Content Types”, select “Yes” for “Allow management of content types?”.
Add custom content type we created to this library:

After this step you’ll see two content types for this document library. You can delete the default content type “Document” and just keep the custom one.:

after deletion:

Step 5 – Save custom document library as template
Next step is to save this custom document library as template so we can create the actual document libraries with rich text column. Under Library Settings, click on “Save document library as template”

Step 6 – Create document library from new template
Now we have created a new document library template, option will appear under “Site Actions > More Options” to create a new library based off that template:

step 7 – Add document to the library
Once the new document library is create based off new template, try adding a new document to this library and notice the rich text box column:

You can use similar steps to add custom rich text columns to picture library.
Hope this helps.

No comments: