More in this section

Forums / Developing with Sitefinity / SiteMenu and SitePanelBar

SiteMenu and SitePanelBar

6 posts, 0 answered
  1. subodh
    subodh avatar
    24 posts
    Registered:
    25 Mar 2009
    01 Apr 2009
    Link to this post
    Hi,
    I have a sitemenu with 3 levels
    like
    example:-
    level0
           level1
           level1  level2
                      level2 level3
                                level3
    Here i want to show only upto level1 on sitemenu. The remaining levels to be shown on sitepanelbar. When user clicks on level1 on sitemenu, the level2 and level3 should appear in a hierarchy form on sitepanelbar.

    Thanks
    looking forward for reply.


                  



  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Apr 2009
    Link to this post
    Hello subodh,

    You can add the following code under ItemDataBound of the SiteMenu control.

      public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e) 
        { 
            CmsSiteMapNode node3 = e.Item.DataItem as CmsSiteMapNode; 
            if (node3 != null & e.Item.Level > 0) 
            { 
                e.Item.Visible = false
            } 

    Thus, only the root level(0) will be shown.

    Then set StartingNodeOffset property of the SitePanelBar to 1

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. subodh
    subodh avatar
    24 posts
    Registered:
    25 Mar 2009
    01 Apr 2009
    Link to this post
    MANY MANY THANKS IVAN,

    The code which u sent will hide all the levels,but i want the level(1) to be shown on sitemenu and the remaining on the sitepanelbar.

    example:-

    level0
           level1
           level1  level2
                      level2 level3
                                level3


    Thanks
    subodh

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Apr 2009
    Link to this post
    Hello subodh,

    Then, change e.Item.Level operand value. Example e.Item.Level >1. You can also change the value of StartingNodeOffset in PanelBar or make changes programmatically as the example shows.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  5. subodh
    subodh avatar
    24 posts
    Registered:
    25 Mar 2009
    02 Apr 2009
    Link to this post
    Thanks Ivan,

    I got it worked with the help of your previous reply and the solution is

        if (e.Item.Level > 1)
            {
                e.Item.Visible = false;
                        
            }

    The above code will show only up to the Level(1) and remaining Level's visibility is set to false.

    My Problem solved.

    Thanks once again Ivan
    Subodh.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Apr 2009
    Link to this post
    Hi subodh,

    I am glad to hear that the example has helped. Just to let you know, you can gather more information about the navigation controls API and how they can be used from Rad Controls for ASP.NET AJAX dev manual.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Register for webinar
6 posts, 0 answered