I've developed a custom web part. I would like to create a feature that when activated via STSADM adds the web part to the default page of a WSS Site. Hopefully this can be done without writing code.
This webpart is meant to de deployed to the web application's bin directory and featurereceiver must be installed to the GAC. The AllUsersWebPart element looks promising, but I can't figure out how to get it to work.
TIA,
jt
The AllUsersWebPart tag allow us to insert one webpart and place it where we want using WebPartOrder and WebPartZone attributes. The content of the tag is the dwp (or webpart) of your webpart. For example, for a dwp:
<AllUsersWebPart WebPartZoneID="MiddleLeftZone" WebPartOrder="0">
<![CDATA[
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
<FrameType>None</FrameType>
<AllowMinimize>true</AllowMinimize>
<IsVisible>true</IsVisible>
<Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
<ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
<Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor">
<Value><iframe src="$Resources:Summary_Url;" frameborder="0" scrolling="no" width="100%" height="100%"></iframe></Value>
</Content>
<PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
</WebPart>
]]>
</AllUsersWebPart>
For a webpart:
<AllUsersWebPart WebPartZoneID="MiddleLeftZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="MyClass, MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f3b9d1137704f880" />
<importErrorMessage>No se puede importar este elemento Web.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="AllowClose" type="bool">False</property>
<property name="AllowMinimize" type="bool">False</property>
<property name="AllowConnect" type="bool">True</property>
<property name="ChromeType" type="chrometype">None</property>
<property name="Hidden" type="bool">False</property>
<property name="AllowEdit" type="bool">False</property>
<property name="AllowZoneChange" type="bool">False</property>
<property name="MissingAssembly" type="string">No se puede importar este elemento Web.</property>
<property name="ChromeState" type="chromestate">Normal</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</AllUsersWebPart>
I haven't tried before but I think it can be done once the web has been created. Try it and tell us.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With