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

1 Answer 1

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 and acknowledge you have read our privacy policy.

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