+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to show pages in main horizontal menu but hide pages from Site PanelBar

How to show pages in main horizontal menu but hide pages from Site PanelBar

3 posts, 0 answered
  1. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    14 Oct 2010
    Link to this post
    Hi Guys,

    I have a scenario where I need to hide menu items from the Site Panel bar but the hidden menu items need to show in the main horizontal menu.

    I understand that hiding the pages removes the menu items from the menu but I need more control over this.

    Can you please point me in the right direction?

    Thanks,
    James
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 Oct 2010
    Link to this post
    Hello James,

    Override ItemDataBound event of your RadPanelBar control and from e.Item.DataItem you can get the reference to RadPanelItem and hide it.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. James
    James avatar
    11 posts
    Registered:
    09 Jan 2008
    08 Apr 2011
    Link to this post
    I had a problem similar to what you are experiencing and I have posted my solution below.  I find this useful especially when I run into this issue in the future.  There might  be some code that is not needed, but it works.

    CmsSiteMapNode hide = e.Item.DataItem as CmsSiteMapNode;
     if (hide != null)
     {
          e.Item.Attributes.Add("PageID", hide.Title);
     {
    if (hide.Title != "Your Page Title")
    {
         e.Item.Visible = true;
     }
    else
    {
      e.Item.Visible = false;
    }
    }
    }
Register for webinar
3 posts, 0 answered