0

Does anyone have any idea how can I bind a term set to the quick launch in SP2013 programmatically? I used the UI but I am getting the same link for both top navigation and quick launch. Any examples or links will be very helpfull

0
web.AllowUnsafeUpdates = true;
SPField field = list.Fields[Constant.docLibViewMetaData];
MetadataNavigationSettings listNavSettings = MetadataNavigationSettings.GetMetadataNavigationSettings(list); 
MetadataNavigationHierarchy mdnNavHierarchy = new MetadataNavigationHierarchy(field);
listNavSettings.ClearConfiguredHierarchies();
listNavSettings.AddConfiguredHierarchy(MetadataNavigationHierarchy.CreateFolderHierarchy());
listNavSettings.AddConfiguredHierarchy(mdnNavHierarchy);
MetadataNavigationSettings.SetMetadataNavigationSettings(list, listNavSettings, true);
list.RootFolder.Update();
list.Update();
web.AllowUnsafeUpdates = false;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.