开发者

Adding a WebPartZone using a feature

In a number of different WSS and SharePoint sites we typically add a LeftNavZone to the default.aspx page using MS Office SharePoint Designer.开发者_C百科 I'd like to write a feature to do this programatically so it can be activated only on certain sites.

Is this possible?

I would like to add it within

<asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server">


You cannot add an WebPartZone to the Pages using a feature. You will have to manually do it, but whereas you can add an webpart to the page using this AllUserWebPart


The way you would normally do this is by creating a site definition using Visual Studio, in which you include all items that should be deployed to the site, like for instance the default page. This allows you control the creation of a new site.

Option 2 is creating a feature that does 2 things.

  • Deploy a new aspx called homepage.aspx to the site, this page contains the desired controls etc.

  • a feauture receiver that is executed when the feature is activated, which sets the site's homepage programmatically to be the newly deployed page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜