本文介绍了如何直接2013的WebParts在ASPX页面布局的SharePoint嵌入作为该布局默认的webpart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SharePoint 2013,并有一个自定义的母版页和几个ASPX布局页所有这一切都被部署被复制到网站设置中的母版页和页面布局一节。

I am using SharePoint 2013, and have a custom master page and several aspx layout pages all of which to be deployed get copied into the "Master pages and page layouts" section within Site Settings.

这些aspx页面包含Web部件区域,但我怎么能在aspx页面的标记添加Web部件,Web部件区域内?

These aspx pages contain web part zones, but how can I add a web part in the markup of the aspx page, within the web part zone?

什么,我基本上是试图做的是使嵌入默认的WebParts到页面的布局,这样,当选择特定页面此布局,它已经的webpart添加到它。

What I'm essentially trying to do is embedd "Default" webparts into the layout of the page, so that when this layout is chosen for particular page, it already has webparts added to it.

我说的开箱即用的webpart,如内容编辑器的webpart和文档库的WebParts的。 2013年,这些都是现在被称为应用程序。

I'm talking about out of the box webparts, such as Content Editor webparts and Document Library Webparts. In 2013 these are all now known as "Apps".

任何建议,大大AP preciated。

Any suggestions greatly appreciated.

推荐答案

最简单的方法是利用设计师的创造code你...

The easiest way is to make use of designer to create the code for you...


  • 创建一个页面,在SharePoint Designer中打开高级模式。

  • 添加所需的WebPart到Web部件区域。这将创建
    所需的HTML。

  • 复制它并从ID值删除G_。

  • 在页面布局使用此code。

诗:ID的Web部件按钮在SharePoint Designer中禁用丝带,只需保存网页。这将启用它。

Ps: Id the WebPart button is disabled in the SharePoint designer ribbon, just save the page. This will enable it.

这是由设计师,当我添加的内容编辑的WebPart和脚本编辑器的WebPart在下面给出产生的code。

The code that is generated by designer when I added Content Editor Webpart and Script Editor webpart is given below.

<WebPartPages:ContentEditorWebPart webpart="true" runat="server" __WebPartId="{BA190D08-907A-4F94-B8F0-C3966A61E601}">
    <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
        <Title>$Resources:core,ContentEditorWebPartTitle;</Title>
        <Description>$Resources:core,ContentEditorWebPartDescription;</Description>
        <PartImageLarge>/_layouts/15/images/mscontl.gif</PartImageLarge>
        <PartOrder>4</PartOrder>
        <ID>ba190d08_907a_4f94_b8f0_c3966a61e601</ID>
    </WebPart>
</WebPartPages:ContentEditorWebPart>

<WebPartPages:ScriptEditorWebPart runat="server" ChromeType="None" Description="$Resources:core,ScriptEditorWebPartDescription;"
    ImportErrorMessage="$Resources:core,ImportErrorMessage;" Title="$Resources:core,ScriptEditorWebPartTitle;"
    __MarkupType="vsattributemarkup" __WebPartId="{1861cebe-9134-4645-8500-13ce8817d416}" WebPart="true"
    __designer:IsClosed="false" partorder="6" id="1861cebe_9134_4645_8500_13ce8817d416">
</WebPartPages:ScriptEditorWebPart>

这篇关于如何直接2013的WebParts在ASPX页面布局的SharePoint嵌入作为该布局默认的webpart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 01:38