Thursday, February 09, 2006

Change the fields in the current view of a listviewwebpart

Something which is pretty handy to know, ... The AllUserswebpart section in ONET.XML defines which webparts are added to a site at site creation. For every list that is created on a site, you can easily add a listviewwebpart by adding <View List="104" BaseViewID="0" WebPartZoneID="Left"/> to the AllUsersWebPart section. The value for the List property references the ListTemplate element in the ListTemplates section - 104 is the ID for the Announcements list. The webpart on default.aspx uses the current view as defined in SCHEMA.XML with BaseViewID=0. If you want to change which fields are displayed in this view, you need to alter the ViewFields section in SCHEMA.XML.

4 comments:

  1. It was about time that I posted something other then a link list ... people were starting to call me a metablogger ;-)

    ReplyDelete
  2. Anonymous3:11 PM

    have you found any way of canging the title for the view element within the modules sectionof the onet.xml? e.g change the heading of the "announcements" wp to "news"?

    Cheers

    ReplyDelete
  3. Anonymous3:11 PM

    have you found any way of canging the title for the view element within the modules sectionof the onet.xml? e.g change the heading of the "announcements" wp to "news"?

    Cheers

    ReplyDelete
  4. Any clue as to how to reference a particular view if multiple views share the same BaseViewID?

    ReplyDelete