Introduction
We will utilize the Managed Metadata Service to create a Term Store and use these Term Stores to set up global navigation for SharePoint 2016 Sites.
This global navigation will display as Mega menus. Here are my site pictures before and after making the changes.
Before
After
Steps
Go to Site Settings, under Site Administration, click Term store management. Select your Site Collection and create New Term Set. I named it as MegaMenu Navigation.
Under Megamenu Navigation, I created more terms as required.
Note
If you decide to change the order of the terms, you can only move terms to different parent terms or go to Custom Sort and modify clicking Use custom sort order.
I will not custom sort for this tutorial.
Now, go to Site Settings, under Look and Feel, click Navigation. Set Global Navigation to Managed Navigation.
Under Managed Navigation
In the Term Set section click MegaMenu Navigation. It is the term that we created.
Click ok and you will see all the terms we created earlier under Global Navigation.
Now it is up to you to style your Global Navigation as you wish.
Here is a simple way to style it. I will create a Custom CSS file and associate it with the default master page.
First let’s create a custom css file and upload it inside Style Library of the root site.
Here is the CSS code,
- #DeltaTopNavigation ul.ms - core - listMenu - root {
- list - style - type: none;
- margin: 0;
- padding: 0;
- background - color: #333;
- }
- # DeltaTopNavigation ul.ms - core - listMenu - root > li {
- float: left;
- }
- #DeltaTopNavigation ul.ms - core - listMenu - root li a {
- display: inline - block;
- color: white;
- text - align: center;
- padding: 14 px 16 px;
- text - decoration: none;
- }
- #DeltaTopNavigation ul.ms - core - listMenu - root li a: hover {
- background - color: red;
- }
- li.dynamic - children ul {
- background - color: #555;
- }
- ul.dynamic{
- width:200px;
- }
I named the css file as megaMenuStyle.css and put it under MegaMenu_MasterPage folder inside Style Library.
Open your site using SharePoint Designer. Go to All Files, _catalogs, masterpage. Copy seattle.master and paste it in the same folder. I named is as MegaMenu.master.
Right click and edit this master page. Before </head> tag insert your CSS link,
- <SharePoint:CssRegistration Name="<% $SPUrl:~SiteCollection/Style Library/MegaMenu_MasterPage/megaMenuStyle.css%>" runat="server"></SharePoint:CssRegistration>
Save and publish your master page.
Now we need to apply our newly created master page to the SharePoint sites. So go to the site settings, under look and feel click Master page.
Specify your newly created master page as default master page and click Ok.
I hope you found this useful.
Here are some useful references that I used,
- https://www.c-sharpcorner.com/article/create-a-responsive-navigation-menu-using-managed-metadata-navigation-in-sharepo/
- https://www.w3schools.com/howto/howto_css_mega_menu.asp