How to hide Home link in SharePoint 2016 global navigation
-
15-02-2021 - |
Вопрос
There is a "Home" link in global navigation of my publishing site which I want to hide. It is not available in "Navigation" in "Site Settings" so I cannot hide it from there.
All the solutions available on internet are about SharePoint 2010/2013 and they are not working for SharePoint 2016. How can I hide that Home link?
EDIT
Here's that element:
<a class="static selected menu-item ms-core-listMenu-item ms-displayInline ms-core-listMenu-selected ms-navedit-linkNode shortpoint-nav-home-link shortpoint-nav-a-selected" accesskey="1" href="/sites/somesite/en/Pages/default.aspx">
<span class="additional-background ms-navedit-flyoutArrow">
<span class="menu-item-text" data-original-word="English">Home</span>
<span class="ms-hidden">Currently selected</span>
</span>
</a>
Решение
I add below style in a Altertive CSS file and it works well here.
a.menu-item.shortpoint-nav-home-link {
display: none !important
}
div#sideNavBox li.static:first-child{
display: none !important
}
Below is my page element:
And you may have a try JS code:
<script src="https://code.jquery.com/jquery-3.1.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("div#sideNavBox span:contains('Home')").closest("li").hide();
})
</script>
Не связан с sharepoint.stackexchange