SharePoint Site has a lot of great web parts.
However, I have found that the Buttons for Site Navigation get spaced out too much, and you need to add each button individually.
While exploring SharePoint Lists, I thought why not to combine Tile View or rather Gallery List View with Hyperlink column and embed list as a webpart on site.
And so I did.
After slightly tweaking JSON I changed the standard white background to themed colour, meaning, it will adapt to the site's theme.
And the great part about using list is that it is dynamic! With every new row you get additional button.
you can also set and apply filter to use same list but different variations of buttons for different site page.
Cool, isn't it?
Start with creating new List from blank .
Add Hyperlink column.
Add more columns for filtering, something simple like text type HomePage ( Y/N), and another column Page2 ...
Enter data
Title cannot be blank, so we have to type something in.
Select Gallery View
Save View as New view, say Buttons, or Home Buttons ( we will need a different view for each set of navigation buttons)
Then Format current view, Edit Card, and leave only Link ticked,
Advanced mode will take you to scary JSON script editor.
Here you can play with custom formatting. Set the width and hight of button, change colours and turn off and on other attributes.
I will change only two: turn off the selecting white circle
change "hideSelection": false,
to "hideSelection": true,
and "class": "ms-bgColor-white (around line 25) to colour of your choice
To help with colour pallet see link to MS Learn documentation
SharePoint site theming - JSON schema | Microsoft Learn
by choosing colour with theme in name makes it dynamic, the button colour will match your site colour theme and will change accordingly.
This is the place to add hover colourNow we can embed List to SharePoint site.
Go to Site, Edit.
Add webpart, List, Select list,
Click Edit icon, select view , hide both command bar and See All button
Apply
Republish
Now your site has nice navigation.
JSON for grabs for list formatting for above
Comments
Post a Comment