April 18, 2007

MOSS: Discussion Board links point to default.aspx when creating List Views in site definition

Problem:
When defining Discussion Boards in Site Definition (in ONET.XML), the subjects of discussion threads point to default.aspx. This means that when clicking on a discussion subject the user is redirected back to the same page. Subject links should point to flat.aspx.

Thoughts:
Some blogs (1, 2) mention a KB article related to this problem and also a MS hotfix that might fix this problem, but it doesn't.

Solution:
Add ContentTypeID="0x012001" into the View element of the Discussion web part in your site definition like this:

<View list="Discussion" baseviewid="0" ContentTypeID="0x012001" webpartzoneid="LeftBottom" webpartorder="1"/>

ContentTypeID is now allowed there according to the schema, but it will still fix the issue.

6 comments:

  1. THANK YOU, THANKS YOU, THANK YOU!!

    I would never have solved this without your help!

    Cheers!

    ReplyDelete
  2. I thank you as well! I need this fix~!!
    Unfortunately, I can't seem to find the onet.xml file to modify.
    Any insight to where the discussion list onet.xml file is located?

    ReplyDelete
  3. YEA! Jussi, thanks!!!!! How did you manage to find this solution?

    ReplyDelete
  4. Hi Jussi! Thank you for sharing such a nice trick! Nevertheless I have one more question :)
    Is it possible somehow to change the list content type and web part title that embeds it at once?

    The result of the code snippet that I created and tried to use is the list content type set to system 0x...

    <View List="$Resources:core,lists_Folder;/Archive" BaseViewID="9" WebPartZoneID="Left" WebPartOrder="1" ContentTypeID="0x012001">
    <![CDATA[
    <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
    <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
    <TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName>
    <Title>Last Posts</Title>
    <ViewContentTypeId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">0x012001</ViewContentTypeId>
    </WebPart>]]>
    </View>

    Can you please advice?

    Thank you!

    ReplyDelete
  5. I need you make me a favor, I got the same problem, because a I copy one discussion board to another discussion board using Sharepoint designer, in the secod discussion board when I click the item it doesn´t take to FLAT.aspx as the first list does, why??? I'm not a computer programmer but I need to solve this for a client. Would you help me please step by step??? please please, I'm from Santiago,Chile and I really need your help, please email me to callitwhatyouwant2003@hotmail.com
    THANK you , I don't know who else can help me, I think you do. Please, thank you

    ReplyDelete
  6. Thank you for this.
    Briliant.

    ReplyDelete