How to make a menu item that is not a link
-
06-02-2021 - |
Question
We are looking at our navigation menu, and we'd like some items to have submenus, but not clickable. Here's an example structure:
- About
- Products
- Product 1
- Product 2
- Product 3
- Contact
In this example, I would like "Products" to not be a link. Clicking would only open the submenu (or not, whatever), but not take you to a new page. Does this make sense?
We are using Modern Sharepoint pages and hub site navigation menus.
Update: Here's what I have in Site Settings:
I click on Quick Launch then Add Header:
And it still requires me to add a link:
Solution
I tested this with my own hub site and took screen grabs.
- Edit the left rail navigation
- Click on the '+' to get the Add a link dialog
Choose "Header" and enter "Display name"
Click "OK" - Repeat the process for your sub-item
If you want to have a link to a document or list item, use the URL option
Otherwise just create another Header - Select your first sub-item and drag it up to the main header
It will move the sub-item under the main header.
Repeat this step for all of your sub-items and click "Save" when finished to preserve your work. - The main header will appear as a drop down item
- Clicking on the main header should just expand the drop down menu and show you the sub-item
Please Note:
These instructions are specifically written for a SharePoint Online Hub Site.
They are current as of the date of this post.
OTHER TIPS
You can activate web feature - SharePoint Server Publishing.
After that, Navigation settings will displayed in Site Settings as on picture below. Now it will be possible to add heading without link.
Also you can access navigation settings by the link - http://YOUR_SITE/_layouts/15/AreaNavigationSettings.aspx
One quick option is to have your URL field be a pound/hash symbol ("#"). This will make the link still 'active' for all intents and purposes, ie: Branding, but the click function will take the user nowhere.
In the Modern Experience, go to the Site Settings page. From here, you can click on the Edit Links button below the Quick Launch bar on the left. For whatever reason, from this menu, it will allow you to enter a Heading without a URL. No idea why it works here and nowhere else, but it works!