How to add calendar and announcement list to my custom web template

Web parts added on the home page automatically when the site is created. just need to provision web parts in onet.xml. Then when you create site, webparts will be added automatically. These will be XSLTListViewWebparts (ListViewWebParts).

If you add following line in onet.xml, this will add Announcements list web part:


<View List="Lists/AnnouncementsMobileView="TRUE" MobileDefaultView="TRUE" BaseViewID="2"  WebPartZoneID="RightWebPartOrder="1" /> 

Similarly you can add other webparts also like calendar etc.
Before you provision web parts, make sure you provision lists. That is also easy. First you need to add publishing feature ID. That will automatically add all lists. You can also add lists separately

http://sharepoint.stackexchange.com/questions/63178/how-to-add-calendar-and-announcement-list-to-my-custom-web-templateInline image 3


More detail (above screenshot is from this page): 

Comments

Popular posts from this blog

SharePoint Integration with IIS

How to Create an Auto-Incrementing Number Field in a SharePoint List

Error:Installing product D:\exchangeserver.msi failed. Fatal error during installation. Error code is 1603.