Add webpage to default WSS page via function

I developed a custom web part. I would like to create a function that, when activated through STSADM, adds the web part to the default page on the WSS site. Hope this can be done without writing code.

This website is intended to be deployed in the bin directory of the web application, and featerereceiver must be installed in the GAC. The AllUsersWebPart element looks promising, but I can't figure out how to make it work.

TIA

Jt

+3
source share
1 answer

AllUsersWebPart - , WebPartOrder WebPartZone. - dwp ( -) -. , 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>&lt;iframe src="$Resources:Summary_Url;" frameborder="0" scrolling="no" width="100%" height="100%"&gt;&lt;/iframe&gt;</Value>
        </Content>
        <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
    </WebPart>
    ]]>
  </AllUsersWebPart>

-:

<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>

, , . .

+4

Source: https://habr.com/ru/post/1704013/


All Articles