Multisite - hide menu node
Hello,
I have a multisite solution and for one of them i need my own node in menu added. As you can see in the attached menu (the new node is green colored).
Is there any way to hide this node for the other site? What i want is when i switch to the other site, this node to be hidden.
Thank you!
Hi Liviu,
There is no such functionality, but you could try to do this by using code behind on the Dashboard Page (SitefinityWebApp.CurrentSite assembly) hiding that Page node:
using System;
using System.Linq;
using Telerik.Sitefinity.Modules.Pages;
using Telerik.Sitefinity.Pages.Model;
namespace SitefinityWebApp
public class CurrentSite : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
var mySite = "MySite";
var pageNode = "NodeNameToHide";
var currentSite = new Telerik.Sitefinity.Multisite.MultisiteContext().CurrentSite.Name;
if (currentSite != mySite)
PageManager pageManager = PageManager.GetManager();
PageData page = pageManager.GetPageDataList().Where(pData => pData.Title == pageNode).FirstOrDefault();
page.NavigationNode.ShowInNavigation = false;
pageManager.SaveChanges();
else
PageManager pageManager = PageManager.GetManager();
PageData page = pageManager.GetPageDataList().Where(pData => pData.Title == pageNode).FirstOrDefault();
page.NavigationNode.ShowInNavigation = true;
pageManager.SaveChanges();
Can you be a little more specific where this code shoud be added? SitefinityWebApp > Properties > AssemblyInfo.cs?
Hi Liviu,
You need to create a class and than add it as code behind of the Backend pages under:
Administration > Backend pages > (expand) Dashboard > Dashboard > Title & Properties > Code behind type (for ASP.NET developers) (example in case the .cs file is in the root folder of the project).
Add this code behind on 'Dashboard' and 'Pages' pages.
Regards,
Svetoslav Manchev
Telerik