Customized MOSS 2007 discussion board definition
As I mentioned in my previous post you can override the default behavior of the “Show Quoted Message” link.
You need to create a custom list template, it is very easy with Visual Studio 2008 and Visual Studio Extensions for SharePoint Services (VSEWSS) 1.3.
I will explain all steps from scratch.
- Install VS 2008 and VSEWSS 1.3 on your development SharePoint server with MOSS 2007 installed.
- Start Visual Studio and create a new project
- Select Visual C# / SharePoint in the tree and List definition in the templates. I used the AlwaysQuotedDiscussionBoard as name
- Open listdefinition.xml and replace “List Definiton1” and “Listdefinition1” to “Always Quoted DiscussionBoard” and “AlwaysQuotedDiscussionBoard”. This will ensure that the list template will have a non-default name.
- Open schema.xml and modify the list name and title in the second row.
- Locate the definition of the field “CorrectBodyToShow”.
- Modify this field definition. There is an <IfEqual> section which controls the value of this computed column, that will be used later to decide if the “Show Quoted Message” link should be rendered. I removed the <IfEqual> with the two expressions, leaving only the internal <Switch> expression, within the outer <Default> tags.
- Save both modified files.
- Open the project properties (right click in the solution explorer on the project name) and on the debug tab edit the “Start browser with Url” field so it points to your site collection. Build and deploy the solution.
After a successful deployment open your site collection and in the create page you will see your new customized list.
Be aware that when you edit your reply, this modified discussion board will show the original reply since you’ve edited the “Quoted Message” while the original short reply is in a hidden column. So the modification will only show up if you click the link. So keep in mind that this implementation has limits.