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

Forums / General Discussions / site menu - how to stop sub items appearing as drop downs

site menu - how to stop sub items appearing as drop downs

7 posts, 0 answered
  1. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    19 Jun 2008
    Link to this post
    Hi

    I have a site map as below

    home
    services
    ----service1
    ----------Item1
    ----------Item2
    ----service2
    contact us


    I have a site menu in services page, which has a starting node offset of 1
    this means it will show all the services in the menu (service 1,2)

    However, i need to stop item 1 and 2 appearing as slide out menus
    I did have a play in the menu settings area, and set something which stopped it showing the sub items (well 99% of them, you could still see the menu slightly)
    if you highlight the menu, and hover, you can still see it showing these items, and the customer is complaining about this

    How would i set this up properly
  2. Mike
    Mike avatar
    22 posts
    Registered:
    05 Mar 2008
    19 Jun 2008
    Link to this post
    Quade,

    In the Sitefinity/Usercontrols/SiteMenu.ascx.cs add the following method.

        protected void RadMenu1_DataBound(object sender, EventArgs e)  
        {  
            foreach (RadMenuItem item in RadMenu1.GetAllItems())  
            {  
                if (item.Level > 0)  
                    item.Items.Clear();  
            }  
        } 


    This will clear those child pages from the menu.


    hope this helps,
    Mike
  3. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    24 Jun 2008
    Link to this post
    Hi Mike

    I've just tried this, but in IE6 you still see the menu drop down
    Ideally i wouldn't use the menu, i'd use a tab strip, but the site is implemented now.

    can any one else comment?

    I've edited the file
    Sitefinity/Usercontrols/Navigation/SiteMenu.ascx.cs
     
    I'd appreciate a quick reply as i need to get this sorted asap

    thanks
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    24 Jun 2008
    Link to this post
    Hi Quade,

    Please send us the modified SiteMenu control that does not work according to expectations in IE6 to test it locally. It will be very helpful if you provide us with an online access to your web site or a screenshot that demonstrates the problem with the display of the items.

    Also, you can investigate the following forum thread that might be useful for you.

    Thanks for your cooperation in advance.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    25 Jun 2008
    Link to this post
    Hi

    Please click here to see a picture of how it looks
    You can see it better when you highlight the menu (as i have done in the example)

    The white boxes are the drop down menu
    and it hides the other menu items

    I've tried the suggestions in the other article with no joy.
    Thanks
  6. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    26 Jun 2008
    Link to this post
    Hello Quade,

    You said you have the following SiteMap structure:

    home
    services
    ----service1
    ----------Item1
    ----------Item2
    ----service2
    contact us

    To remove "
    Item1" and "Item2" from the navigation control, you need to implement the following in the RadMenu1_ItemDataBound method of the SiteMenu control:

    public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e) 
        { 
            if (e.Item.Level >= 1) 
            { 
                e.Item.Visible = false
                e.Item.Owner.Items.Clear(); 
            } 
    ... 

    Please note that the check for the Level of the current item should be different depending on the position of the page in the SiteMap.

    If this does not help, send us both your project and database to debug the issue locally.

    Best wishes,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. subodh
    subodh avatar
    24 posts
    Registered:
    25 Mar 2009
    01 Apr 2009
    Link to this post
    I had the same issue and thanx Mike and pepi both have done a good job. You just kept me out of danger.
Register for webinar
7 posts, 0 answered