So I decided to use managed navigation feature for a site I'm working on, however as a requirement, there's a need to have three different sections of navigation (top, side, bottom) and because of the limitation to use only one term set as managed navigation on each site collection, I decided to create two web parts to fulfill the requirement (side and bottom). It's important to mention that the same manageability provided to the top navigation bar with termset is required for this other two sections.
When I edit the page to test the web parts, the side web part works just fine, but when I add the bottom web part, the top navigation bar and the ribbon stops wroking, meaning, all buttons on the ribbon are disabled and the second level of the navigation top bar isn't showed. The only difference between this two webparts is that in the side web part I use an ASP control tree view and populate it, meanwhile, in the bottom web part I create those tree views dinamically.
Here's the code for the bottom web part:
TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
TermStore store = session.TermStores[0];
Group group = almacen.Groups["Nav"];
TermSet termSet= group.TermSets["Bottom"];
NavigationTermSet navTermSet = NavigationTermSet.GetAsResolvedByWeb(termSet, SPContext.Current.Web, StandardNavigationProviderNames.GlobalNavigationTaxonomyProvider);
foreach (NavigationTerm navParentTerm in navTermSet.Terms)
{
TreeView tree= new TreeView();
tree.ID = "tvData" + navParentTerm.Title.Value;
tree.ShowExpandCollapse = false;
TreeNode parentNode = new TreeNode(navParentTerm.Title.Value);
parentNode .NavigateUrl = navParentTerm.TargetUrl.Value;
parentNode .ToolTip = navParentTerm.HoverText;
tree.Nodes.Add(parentNode );
foreach (NavigationTerm navTerm in navParentTerm.Terms)
{
TreeNode childNode = new TreeNode(navTerm.Title.Value);
childNode.NavigateUrl = navTerm.TargetUrl.Value;
childNode.ToolTip = navTerm.HoverText;
tree.Nodes[0].ChildNodes.Add(childNode);
}
tree.CssClass = "BottomMenu";
pnlLinks.Controls.Add(tree);
Thanks in advance.