문제

I have a site definition created from team site, and I activated publishing feature on this site, the pages appear on left and top navigation once I create the site. I have feature receivers on the site that create my navigation dynamic.

I tried to remove <nav> from the site definition but that broke the navigation. how do I remove unnecessary pages that I added in my features from navigation?

도움이 되었습니까?

해결책

Since you have activated publishing feature on your site, you can include this code in your feature reciever that creates the navigation:

              //get reference to the publishing web, store it in publishingWeb
              //This is how to do it for quick launch                   
              publishingWeb.Navigation.CurrentIncludePages = false;

              //This is how to do it for top navigation
              publishingWeb.Navigation.GlobalIncludePages = false;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top