我在SharePoint 2013中有一个母版页(.html)文件。在此,我正在生成全局导航。因此,我编写了HTML和一个Angular控制器,它从列表中获取数据并将其绑定到此HTML以生成导航。
问题是:
主页库URL在实际URL之前加前缀。因此,而不是http://sitecollectionurl/Pages/MyPage.aspx
,URL生成为:http://sitecollectionurl/_catalogs/masterpage/branding/http://sitecollectionurl/Pages/MyPage.aspx
对这个问题的任何想法?提前致谢。
我想你总是可以在你的URL中使用网站集令牌。
~sitecollection
URLs and tokens in SharePoint 2013
如果这对你不起作用,这篇博客文章在使用masterpages和参考资料时有很多很好的例子。 Use Site Url in SharePoint
也许你需要这个?
<SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/_catalogs/masterpage/css/style.css %>" runat="server" />