April 16, 2007

MOSS: Setting list view title in ONET.XML

Title of a list view (ListViewWebPart) cannot be defined in ONET.XML so it cannot be set different from the title of the list it is showing.

If I modify the title with a browser (Modify Shared Web Part / Appearance / Title) and save the site as a template the new title is nowhere in the .stp file, still if I use that template to create a site the changes are there.

Use the WebPart tag and define the Title under it. In the following example a minimized List View Web Part is added with a title My custom title.

<View List="Documents" BaseViewID="11"
WebPartZoneID="Left" WebPartOrder="3" Scope="Recursive">
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint, Version=, Culture=neutral,
<Title>My custom title</Title>


  1. Hi,

    I want to show the ListView webpart as minimized.

    In order to do this I need to change the Chrome State.

    Do i change it the same way you did with the Title?

    And what is the property I need to change??

  2. You can have it minimized by defining


  3. thanx for the really really fast reply. I have the code below in my onet.xml file.

    when I create the site from the site definition. the list is still displayed in the normal state.

    Is there anything i'm missing, some prerequisites maybe.

    like everything in sharepoint it looks really really simple. yet somehow it actually isn't.

    Code had been modified [ = < and
    ] = >

    [View List="Lists/RegelingenLinks" BaseViewID="0" WebPartZoneID="wpzLeft" WebPartOrder="4" ]
    [WebPart xmlns="http://schemas.microsoft.com/WebPart/v2"]
    [Assembly]Microsoft.SharePoint, Version=, Culture=neutral,

  4. I don't have a ready answer for you, but based on my testing (exporting web part and importing it), you could try having these three properties:


    FrameState appears to be obsolete and you should only use ChromeState, but only having ChromeState doesn't work. AllowMinimize must be true in order to be able to minimize web parts. It defaults as true, but it doesn't hurt trying to define it explicitly.

    Also, if this doesn't help, can you try to export a minimized web part and try re-importing it to see if that works. If yes, then there is some issue that is related to onet.xml and minimized web parts.

  5. How do you do this for Sharepoint 2003?
    I tried exactly your code (Except the assembly version is 11), but it doesn't seem to work.

  6. Can you change the list view settings also ?? I mean can you define properties for customized views

  7. Hi,
    could you help me changing the chrometype property to titleandborder for a listview webpart?

  8. Have you tried exporting the web part and seeing how the ChromeType is defined?

    Exporting stuff after modifying them using browser is often a good way to find out how to do things declaratively.

  9. Hey thanks a lot Jussi.. It helped me a lot [:)]

  10. Fantastic! I wish I'd found this years ago - not being able to set the list view title in a Site Def has annoyed me for years!