Sep 27 2016 06:00 PM
Currently I'm trying to implement global navigation cross site collections ( SharePoint Online/2016 ), currently there are some planned approaches, just want to get some different ideas and options, with considering implementation, performance and maintenance
Sep 27 2016 10:33 PM
for me option 3 looks best. but be aware you do not change the masterpage..
Sep 28 2016 08:19 AM
SolutionHi @Shawn Xiong. Maybe you can take a look at this sample on the PnP GitHub repository:
https://github.com/OfficeDev/PnP/tree/master/Components/Core.TaxonomyNavigationComponents
It corresponds to your 3rd option. Behind the scenes, this sample uses RequireJS and the JavaScript injection technique to build a top navigation bar. All navigation links are managed through a taxonomy term set and are retrieved via JSOM.
If you want, you have also an other solution using Webpack and the SharePoint "Script On Demand" loading technique (instead of RequireJS):
https://github.com/OfficeDev/PnP/tree/master/Solutions/Business.O365StarterIntranet
In this case you will need to create a custom master page to load the JS files.
Hope this help!
Franck.
Sep 28 2016 04:56 PM
Hi @Franck Cornu,
Thanks for the reply, Core.TaxonomyNavigationComponents is closer to what I'm after, and the SOD looks closer too me.
Just one concern, by using managed metadata as datasource, will it incur any performance issue, surely I can implment javascript client site caching, anything we can do to get better performance from server/service side.
thanks,
Shawn
Sep 28 2016 06:14 PM - edited Sep 28 2016 07:19 PM
Hi @Shawn Xiong
Indeed, query the taxonomy service at every page load can be time consuming for sure (and not really usefull because links don't change every time). If you want an example showing how to build a cache system for the navigation, I've implemented one using a configuration list and the local storage capability of the browser.
Franck.
Sep 28 2016 06:51 PM
Thanks for the reply @Franck Cornu, it looks good too.
I probably go with Term Store as data repository, JSOM to retrieve the data, local storage with expiry date + custom js event to reset local storage in the browser.
Sep 18 2017 06:01 PM
Hi Shawn,
Understand this is an old post. But I'm in a similar situation. Did you end up creating a custom master page or created the top nav using a JS injection method?
I'm very tempted to use a custom master page as my requirement is just for one publishing site collection. Appreciate your response.
Thanks,
Kannan
Sep 18 2017 06:12 PM
Hi @Kannan, you can take a look at the PnP Starter Intranet.
This class could be very useful for your case (see the getNavigationTaxonomyNodes nethod). You don't need to use the full solution.
Franck.
Sep 18 2017 06:52 PM
Thanks @Franck Cornu. Taking a look at it now. :)
Sep 19 2017 10:18 PM
If it's just for custom navigation, better not using custom master page.
So I ended up with two version of implementation:
Using PnP-PowerShell for the deployment and provisioning.
As @Franck Cornu mentioned, TaxonomyModule.ts is where the magic happens.
Sep 19 2017 10:36 PM