在SP 2016中的“添加应用”页面上仅显示自定义库 [英] To show only custom library on 'Add an app' page in SP 2016
问题描述
Hi Team,
我们正在使用SP 2016平台
我们要求只显示我们自定义的文档库模板在"添加应用"页面上创建
剩余的OOTB列表& 其他模板将保持不变
请分享指针
问候,
Akshay
addanapp.aspx是系统页面所以我建议你将JavaScript注入页面,然后重定向到自定义应用程序页面(备份
页面)。< asp:Content ContentPlaceHolderId = QUOT; PlaceHolderMain" RUNAT = QUOT;服务器">
< div id =" idStorefrontLayoutRoot">< / div>
< script type =" text / javascript" SRC =" HTTPS://code.jquery.com/jquery-1.12.4.js">< /脚本>
< script>
函数getQueryVariable(变量){
var query = window.location.search.substring(1);
var vars = query.split('&');
for(var i = 0; i< vars.length; i ++){
var pair = vars [i] .split('=');
if(decodeURIComponent(pair [0])== variable){
return decodeURIComponent(pair [1]);
}
}
console.log('查询变量%s未找到',变量);
}
(function(){
var useOOBCreate = getQueryVariable('OOBTemplate');
if(!useOOBCreate)
window。 location.replace(" http:// sp2016:12001 / _layouts / 15 / start.aspx#/ SitePages / DevHome.aspx");
})
< / script>
< / asp:Content>
要使用OOB模板,请设置 OOBTemplate参数。
http:// sp2016:12001 / _layouts / 15 / addanapp.aspx?OOBTemplate = true
创建自定义应用程序页面。
在自定义应用程序页面中,根据自定义列表模板实现自定义代码以创建列表。
最好的问候,
李
跨度>
Hi Team,
We are using SP 2016 platform
We have a requirement to show only custom document library template we have created on 'Add an app' page
Rest of the OOTB list & other templates will remain as is
Please share the pointers
Regards,
Akshay
Hi,
addanapp.aspx is system page so I would suggest you inject JavaScript into the page and then redirect to custom application page(backup the page).
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> <div id="idStorefrontLayoutRoot"></div> <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script> <script> function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); if (decodeURIComponent(pair[0]) == variable) { return decodeURIComponent(pair[1]); } } console.log('Query variable %s not found', variable); }
(function(){ var useOOBCreate=getQueryVariable('OOBTemplate'); if(!useOOBCreate) window.location.replace("http://sp2016:12001/_layouts/15/start.aspx#/SitePages/DevHome.aspx"); }) </script> </asp:Content>
To use OOB template,set OOBTemplate parameter.
http://sp2016:12001/_layouts/15/addanapp.aspx?OOBTemplate=true
Create custom application page.
In custom application page, implement your custom code to create list based on your custom list template.
Best Regards,
Lee
这篇关于在SP 2016中的“添加应用”页面上仅显示自定义库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!