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&#8243; 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 (<View BaseViewID=”2″) .

and Change BaseViewID = “20” of newly created view

and Change display name to DisplayName=”Flat Anonymous”

6. Find    <FieldRef Name=”PersonViewMinimal”>

from newly copied view

7. Rename it to

<FieldRef Name=”PersonViewMinimalExtended”>



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

Then select “Flat Anonymous” as the template.

4 thoughts on “Discussion board anonymous reply with custom view

  1. Hi,

    We created a disussion board for our dir where where we can ask question. But i want to hide the user identity as in who is asking what questions.

    how do i hide user information?

    1. Hi John,

      Hope you have MOSS2007.

      Above steps are to modify(customize) default DiscussionsList\schema.xml and make our own view from PersonViewMinimal (this is part of DiscussionsList\schema.xml file).
      That allows us to change the appearance of the List Item when it displaying on the grid.

      Logic:
      If you analyse the XML fragment given in the Step 4 ,
      you can find a CASE statement which check if it is the ROOT (1st) post then it displays the person info. This is to allow Author Image,Name to be displayed.
      and the DEFAULT (if it is not the Author, means other who replied to this discussion) the person info will not populated.
      This allows us to hide the reply persons info…(hmmm…ya it is not actually ANONYMOUS because person info already in the database…but invisible 🙂 )

      Thanks,
      Dilhan.

Leave a comment