Forum Discussion
PNP provisioning -Updating a list removes it from navigation
Hi Pieter,
Thank you for replying. I've tried to break my code down further with an example to be able to share with you, and as you have found the left hand navigation remains.
Leave it with me, and I'll get you an example that does what I'm experience, or I will work out and understand why it's happening and post my findings to help someone else.
Thanks.
Paul
I have been able to replicate our problem. I provide you with 3 files.
PNP problem files in my OneDrive
From a brand new site collection using the classic Team site.
Apply-PnPProvisioningTemplate -Path:'./otbsite.xml' -Verbose
This will create a new list called 'Show on Nav', and included on the left hand navigation. I have also changed the homepage to be a modern page. (Welcome.aspx).
After you have done this run
Apply-PnPProvisioningTemplate -Path:'./otbsite.1.xml' -Verbose
This then updates the 'Show on Nav' views to include the version column. After this is run, the left hand navigation no longer shows 'Show on Nav'.
It looks like it's to do with the view Url, as we are using this template on multiple tenants, multiple site collections, we removed the original Url as '/sites/PNPTemplate/Show on Nav/Forms/AllItems.aspx' to '{site}/Show on Nav/Forms/AllItems.aspx'
However, after running the template otbsite.1.xml again and replacing the URL of the view from {site}/Show on Nav/Forms/AllItems.aspx' with '/site/blah/Show on Nav/Forms/AllItems.aspx' it doesn't remove from the left navigation, and the views still seem to work OK.
Still having an issue with Lists though.
Even though I have worked out the problem, do you think this is an error in PNP or SharePoint itself?
- Nov 10, 2017
Hi Paul Matthews,
I ran both xml templates and my show on nav list is still in the left hand navigation.
- Paul MatthewsNov 10, 2017Brass Contributor
I do appreciate you helping me with this. I made a mistake on the original otbsite.1.xml template, the List Instance had 'OnQuickLaunch="true". So originally the link was sub heading underneath the Documents navigation. After you ran the second template it put back, but at the bottom of all the links. (I was also caught out by this, and why I think putting '/sites/blah/' worked. It did not)
Before
After
I have since update otbsite.1.xml in my onedrive, it no longer has the 'OnQuickLaunch' in the template. Now when you run it you should experience the same problem I'm getting where the link disappears from the Navigation. Please grab new copy and run otbsite.xml followed by otbsite.1.xml again.
When I look at the verbose longs for the PNP, it always says it's "Creating" a view, never updating. Didn't know if this was the reason, perhaps the view I'm pointing to is deleted before recreated, as soon as it's deleted, SharePoint is removing any navigation links to it?
- Nov 10, 2017
HI Paul Matthews,
Ah, ok now I understand. Yes I think I've seen this a while back too. If I remember correctly the navigation options are removed before the option is applied. In the past ( about 2 years ago) we ended up with multiple entries for the Libraries that appear in the left hand nav. I thought that there was a switch in the template that allows you to make sure that the navigation isn't removed. But I don't think that option is available at the list level. Only within the navigation sections of the template there is switch to remove or not remove the existing links.