如何将Web部件的推荐链接添加到页面并设置JSLink

时间:2014-03-06 11:15:41

标签: sharepoint sharepoint-2013

我正在尝试按照Muawiyah Shannak http://code.msdn.microsoft.com/office/Sharepoint-2013-How-to-add-e2966a24#content的文章,将推广链接web par部署到default.aspx页面。 但我无法找到如何在标记中设置JSLink URL。

<div> 
        <WebPartPages:WebPartZone ID="WebPartZone" runat="server" FrameType="None"> 
            <WebPartPages:XsltListViewWebPart 
               ID="XsltListViewArticlePromotedList" 
                runat="server" 
                ListUrl="Lists/MyPromotedLinks" 
                IsIncluded="True" 
                NoDefaultStyle="TRUE" 
                Title="Images used in switcher" 
                PageType="PAGE_NORMALVIEW" 
                Default="False" 
                ViewContentTypeId="0x"> 
            </WebPartPages:XsltListViewWebPart> 
        </WebPartPages:WebPartZone> 
    </div> 

1 个答案:

答案 0 :(得分:1)

XsltListWebPart.JSLink property将CSR文件设置为呈现列表视图:

<JSLink>~site/SiteAssets/PromotedLinks.js</JSLink>

其中~site是一个网址令牌。

有关详细信息,请参阅URLs and tokens in SharePoint 2013