Provision smartpart (or other custom webparts) with a site definition (onet.xml)

Smartpart uses some custom properties to point to the usercontrol. I found a really simple trick to find the code you need to embed to you onet.xml.
 
Just open your sharepoint site, add smartpart to a webzone, make your smartpart settings. Go to Edit -> Export. Save the file as a XML file. Copy everything excluding the first line and past it into your onet.xml in the CDATA part of your AllUsersWebPart. Et voila your custom webpart is ready for deployment, just dont forget to install and activate the custom webpart.

One Reply to “Provision smartpart (or other custom webparts) with a site definition (onet.xml)”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.