Wednesday, October 11, 2006

SharePoint 2007 : WebParts in Modules

When adding web-parts to pages through modules, the 2007 syntax for the web-part is different. The section below shows (pretty much) the minimum you can get away with...

<AllUsersWebPart WebPartZoneID="Left" WebPartOrder="1">
<![CDATA[
                   <webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="MultiplePartLibrary.Another, MultiplePartLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Another</property>
</properties>
</data>
</webPart>
</webParts>
   
   
                   ]]>
</AllUsersWebPart>

SharePoint 2007 : Exporting web-parts

Whilst working with web-parts in 2007 I was expecting to find the same Export option when in edit mode. It wasn't there....

Turns out you need to enable export for a web-part through the Toolpane....

Under the Advanced section, there should be an Export Mode drop-down. Change the setting and you should see the Export menu appear as in 2003.

Thursday, October 05, 2006

Intellisense in SharePoint XML files

I got this from the Ted Pattison videos:

If you want intellisense in the SharePoint Feature/Solution/Onet xml files, then reference the schema in VStudio.

To do that, open the file you want to modify, open the Properties window in VStudio. In schemas, reference the following file:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\wss.xsd

Wednesday, October 04, 2006

Master Pages and Static Tokens

We were having some drama provisioning master-pages through the modules mechanism, then getting the site pages to reference the correct master page.

Ended up with this in the site pages...


MasterPageFile="~site/_catalogs/masterpage/nick.master"

It doesn't seem to work using "~masterurl/nick.master" which I guess would be the obvious solution...