如何在sharepoint 2013的快速启动中隐藏最近的标记?
最近,我得到一个要求,在快速启动,我们需要隐藏最近的标签 它不应出现在任何页面和列表中,在子站点级别或站点集合级别下如何在sharepoint 2013的快速启动中隐藏最近的标记?,sharepoint,sharepoint-2013,sharepoint-designer,Sharepoint,Sharepoint 2013,Sharepoint Designer,最近,我得到一个要求,在快速启动,我们需要隐藏最近的标签 它不应出现在任何页面和列表中,在子站点级别或站点集合级别下 如果有人知道,请告诉我创建一个Web部件并将其添加到母版页中 在母版页外观中添加Web部件的步骤 在您的Web部件上使用此javascript:- <script> $(document).ready(function(){ $(".ms-core-listMenu-item").each(function(){ if($(this).text().indexO
如果有人知道,请告诉我创建一个Web部件并将其添加到母版页中 在母版页外观中添加Web部件的步骤 在您的Web部件上使用此javascript:-
<script>
$(document).ready(function(){
$(".ms-core-listMenu-item").each(function(){
if($(this).text().indexOf("Recent")!=-1){
$(this).parent("li").hide();
}
});
});
</script>
$(文档).ready(函数(){
$(“.ms核心列表菜单项”)。每个(函数(){
if($(this).text().indexOf(“最近”)!=-1){
$(this.parent(“li”).hide();
}
});
});
没有测试,但它应该工作
注意:添加javascript引用我使用的解决方案是创建一个SharePoint组(我称之为我的“RemoveRecent”),并且没有为该组分配任何用户。这将有效地对所有人隐藏菜单项 然后,我使用这个PowerShell脚本将“RemoveRecent”组添加到“最近”快速启动导航链接的“受众定位”部分
$Site = Get-SPSite "https://SITECOLLECTION/"
foreach ($Web in $Site.AllWebs)
{
$PublishingWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$QuickLaunchNav = $PublishingWeb.Navigation.CurrentNavigationNodes
$QuickLaunchHeading = $QuickLaunchNav | where {$_.Title -eq "Recent"}
if ($QuickLaunchHeading)
{
Write-Host $Web.Title "- " -ForegroundColor Green -BackgroundColor Black -NoNewline
$QuickLaunchHeading.Properties["Audience"] = "RemoveRecent"
$QuickLaunchHeading.Update()
Write-Host $QuickLaunchHeading.Properties["Audience"] -ForegroundColor Red -BackgroundColor Black
}
}