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

Forums / General Discussions / Menu question

Menu question

13 posts, 1 answered
  1. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    05 Sep 2012
    Link to this post
    I have about 75 pages in the project, but only really two looks. First page and everything else.
    So naturally i created two page templates and stuck all the navigation in there, so that all pages have it ready.
    I put a top nav bar at the top with some 5 items, and a side one that has all the sub-menus.

    This is where i can't quite get it to work the way i want. I would like the side menu to never show the top items since they are already in the top area. In other words if the user is anywhere within the home section, i want the side menu to show everything that is under Home.

    There appear to be 3 choices only either show everything, including the top level, show everything under the currently selected item. Or show everything under a specific page.

    Naturally i could simply put the navigation in each page and make it show everything from a selected page, or make 6 templates and assign the pages to one of the templates.

    But if i then move the page from one section to another i will need to edit the menu or assign a different template to it. I would rather have this work more dynamically. 

    Is there a way i can keep just one template and somehow set the menu to show all in the currently selected section apart of the top item?
  2. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    05 Sep 2012
    Link to this post
    Dear Andrew I use RadControls for this.

    Here is what I have.

    Tamplate Home with main navigation
    Tamplate Normal with subnavi in it

    I use RadControls for Subnavi (you need to acitve them in Admin - Advanced -  Toolboxes - Radcontrols if I remember correct)

    Then under Daten Drag the Sitemap Datasource to your page (sorry SBE German no way to know what's it in english) sf_subnavi_01.png

    ShowStartingNode = False
    SiteMapProvider = SitefinitySiteMap
    StartFromCurrentNode = False
    StartingNodeOffeste = 1


    Copy the ID to clipboard Ctrl + C

    Then drag the RadControl (I use Panelbars a lot) to the template page

    DataSourceID set to the one from sitemap datasource Ctrl + V should do the trick.

    Remember for styling you need to turn off embeded skins and stuff.

    ------

    Old fashion, not out of the box, but works every time and I can set my own styles which is less then using embed.

    Markus
    Answered
  3. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    05 Sep 2012
    Link to this post
    Sounds like a good plan.
    However i cannot find how to activate those RadControls.

    I can go to Admin - Settings - Advanced - Toolboxes. but there i can only delete or add new items.
    Don't see a way to activate anything.

    -UPDATE-
    Found it now. Just enabled them and will try your solution.
  4. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    05 Sep 2012
    Link to this post
    Dear Andrew

    Glad you found it. For others who did not find it right away see screenshot.

    Markus


  5. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    05 Sep 2012
    Link to this post
    That worked like a dream.
    Thanks Markus, du bist ein Genie
  6. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    05 Sep 2012
    Link to this post
    Dear Andrew

    Thank's for the flower but an a Genie level from 0 - 100 I am at 10. 

    I wanted, PanelBar, Menu with flyout to right and stuff in my secondary navigation. Back some time SF would not provide these options so I had to choose this path. Don't know if 5.1 has panelbar and flyout menu now to be used as secondary navigtion with first item ignoring.

    This works for me at the moment.

    Glad I could help. Usually I am the one getting help :-)

    Markus
  7. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    05 Sep 2012
    Link to this post
    I have one more question.
    Do you know if i can disable the collapse functionality?
    I want to have all the item extended. All open in essence.
    Is that possible with the panel?
    I have been looking at the Telerik demos but can't see an example there.
  8. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    05 Sep 2012
    Link to this post
    Dear Andrew

    PanelBar has 3 Expand Modes
    http://mono.telerik.com/PanelBar/Examples/Functionality/PanelbarBehavior/DefaultCS.aspx 

    There is no such thing out of the box as far as I know
    but there are workarounds
    http://www.telerik.com/community/forums/aspnet/panelbar/radpanelbar-for-dnn-how-to-automatically-expand-all-the-items-when-loading.aspx 

    Taken from this page this might work in JavaScript. Did not test it just changed Collapse to Expand. Don't know if there is such a thing.

    <script type="text/javascript"
    function CollapseAllItems() 
        var panelbar = <%= RadPanelbar1.ClientID %>
        for (var i=0; i<panelbar.AllItems.length; i++) 
        
            panelbar.AllItems[i].Expand(); 
        
    </script>

    I usualy dont want all to be expanded. 

    Markus
  9. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    05 Sep 2012
    Link to this post
    Thanks Again.
    I will try this.
  10. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    07 Sep 2012
    Link to this post
    Can't get it to work. I tried putting a script widget with this:
    var panelbar= document.getElementById("T1CF96E6D009");
     
    for (var i=0; i<panelbar.AllItems.length; i++)
        {
            panelbar.AllItems[i].Expand();
        }
    and this:
    var panelbar= document.getElementById("T1CF96E6D009");
     
    for (var i = 0; i < panelbar.get_allItems().length; i++) { 
        if (panelbar.get_allItems()[i].get_items().get_count != 0) { 
            panelbar.get_allItems()[i].set_expanded(true); 
        
    and:
    var panelbar= document.getElementById("T1CF96E6D009");
     
    for (var i = 0; i < panelBar.get_allItems().length; i++) {
               panelBar.get_allItems()[i].expand();
           }
    and nothing works.
    I know this is the correct element, i used an alert to confirm it is finding it.
  11. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    07 Sep 2012
    Link to this post
    Dear Andrew

    I would open a support ticket and link to this thread. They are way smarter then my guess work.

    Markus
  12. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    07 Sep 2012
    Link to this post
    @Markus

    The question was not directed at your specifically, thought perhaps someone else reading this would know.

    But thanks for checking in again.
  13. Richard
    Richard avatar
    49 posts
    Registered:
    13 Jul 2010
    16 Sep 2013
    Link to this post
    Just a quick message to say thank you very much Markus for this - a very useful tip indeed. I was scratching around for ages to replicate this when it was really very simple, once the rad controls were revealed.

    Thanks again Markus.
13 posts, 1 answered