Pages

Sunday, January 10, 2010

Discussion board anonymous reply with custom view

We can achieve this requirement by adding new list view template to Discussion List, i will call it "Flat Anonymous".

Steps,

1. Open FEATURES\DiscussionsList\schema.xml

(Exact Path : Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\DiscussionsList\schema.xml)

(don't forget to Backup schema.xml file before doing any modifications)

2. Find PersonViewMinimal

3. Create a copy and name it PersonViewMinimalExtended

4. it should look like following

<Field ID="{b4ab471e-0262-462a-8b3f-c1dfc9e2d5fd}" Name="PersonViewMinimalExtended" DisplaceOnUpgrade="TRUE" Group="_Hidden" Filterable="TRUE" Sortable="TRUE" Type="Computed" DisplayName="$Resources:core,Posted_By;" ReadOnly="TRUE" AuthoringInfo="$Resources:core,picture_and_name;" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="PersonViewMinimalExtended">

<FieldRefs>
<FieldRef ID="{d31655d1-1d5b-4511-95a1-7a09e9b75bf2}" Name="Editor" />
<FieldRef ID="{adfe65ee-74bb-4771-bec5-d691d9a6a14e}" Name="PersonImage" />
<FieldRef ID="{bd2216c1-a2f3-48c0-b21c-dc297d0cc658}" Name="IsRootPost" />
</FieldRefs>

<DisplayPattern>
<Switch>
<Expr>
<Field Name="IsRootPost" />
</Expr>
<Case Value="TRUE">
<HTML><![CDATA[<table cellpadding="0" cellspacing="0"><tr><td style="padding-left: 5px;">]]></HTML>
<Field Name="PersonImage" /><HTML><![CDATA[</td></tr><tr><td style="padding-left: 5px;" nowrap>]]></HTML>
<Field Name="Editor" /><HTML><![CDATA[</td></tr></table>]]>
</HTML>
</Case>
<Default>
<HTML><![CDATA[&nbsp]]></HTML>
</Default>
</Switch>
</DisplayPattern>

</Field>





5. find $Resources:core,DiscussionViewFlat;

and create a copy from that view () .

and Change BaseViewID = "20" of newly created view

and Change display name to DisplayName="Flat Anonymous"

6. Find

from newly copied view

7. Rename it to
Now go to SharePoint site discussion board list and create new view.

Then select "Flat Anonymous" as the template.

No comments: