Site template with custom webpart
Hi,
i like to create a site template which has by default my custom webpart.
so that when i create my site with the template my webparts will be readily available.
please tell me if it is possible.
ullasjoshi
May 3rd, 2010 9:38am
Hi Ullas,
Yes, it is possible. Follow this article to create your custom site definition:
http://www.toddbaginski.com/blog/archive/0001/01/01/creating-a-custom-site-definition-in-wss-v3-moss.aspx
Also, check these links for adding webparts to your custom Site definition:
http://vspug.com/nicksevens/2007/11/23/adding-custom-webparts-in-a-sharepoint-site-definition/
http://stackoverflow.com/questions/234302/how-to-add-a-web-part-page-to-a-site-definition
Hope this helps.BR, PM
Free Windows Admin Tool Kit Click here and download it now
May 3rd, 2010 9:50am
thanks prasanjit, i will implement n let u know.ullasjoshi
May 3rd, 2010 9:56am
hi,
i tried above method. i am getting following error
A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe
this i was the code i updated in onet.xml
<AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1">
- <![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>WA.WebPart, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2b4b09f1c57c8f0b</Assembly>
<TypeName>WA.WebPart</TypeName>
<FrameType>None</FrameType>
<Title>Custom webpart example</Title>
</WebPart>
]]>
</AllUsersWebPart>
please help.
ullasjoshi
Free Windows Admin Tool Kit Click here and download it now
May 3rd, 2010 12:07pm
Hi,
Please check if WA.Webpart.dll exists in GAC and also if the corresponding safe control entry is added in web.config of root web application.
Regards,
Manvir
May 3rd, 2010 3:46pm
Hi,
yes webpart dll exists in gac and safe control is added.ullasjoshi
Free Windows Admin Tool Kit Click here and download it now
May 4th, 2010 7:41am
Hi all,
i created a fresh new site template using visual studio 2008, followed above links and was able to deploy custom webpart.
thanks a lot :-)
ullasjoshi
May 10th, 2010 1:47pm
Excellent..great job!!BR, PM
Free Windows Admin Tool Kit Click here and download it now
May 10th, 2010 1:54pm