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

Forums / Developing with Sitefinity / SitePanelBar - displaying sub-pages

SitePanelBar - displaying sub-pages

4 posts, 0 answered
  1. Elizabeth
    Elizabeth avatar
    83 posts
    Registered:
    23 Mar 2005
    30 Oct 2009
    Link to this post
    This is the structure of the site:

    Page 1
        secondary a
        secondary b
            tertiary 1
        secondary c
    Page 2
        secondary a
        secondary b
            tertiary 1
            tertiary 2
        secondary c

    I want to know if the SitePanelBar can work this way:

    When a user is on or under Page 1, they see all the secondary and tertiary pages, as well as Page 2. Right now the user sees the secondary pages, but not the tertiary page until they click on the tertiary page's parent.

    Thanks,
    Elizabeth
  2. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    01 Jun 2017
    02 Nov 2009
    Link to this post
    Hello Elizabeth,

    You can try expanding all items on client side:

    1. Open ~\Sitefinity\UserControls\Navigation35\SitePanelbar.ascx
    2. Set OnClientLoad function:
    <telerik:RadPanelBar ID="RadPanelbar1" runat="server" DataSourceID="SiteMapDataSource1" OnItemDataBound="RadPanelbar1_ItemDataBound" EnableViewState="false" OnClientLoad="expandAll">
    3. At the bottom add the "expandAll" function:
    <script type="text/javascript">
        function expandAll() {
            var panelBar = $find("<%= RadPanelbar1.ClientID %>");
            for (var i = 0; i < panelBar.get_allItems().length; i++) {
                panelBar.get_allItems()[i].expand();
            }
        }
    </script>

    Here you can find more about RadPanelBar's Client-Side API.

    Best wishes,
    Nikolai
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Elizabeth
    Elizabeth avatar
    83 posts
    Registered:
    23 Mar 2005
    02 Nov 2009
    Link to this post
    I tried that, and it didn't have any affect. I added an alert inside the function to make sure it was being called and it was but it didn't affect what was expanded.

    But also looking at the function, it looks like it would expand all items in the panel bar, and I only want to expand the items within Page 1 or 2 (depending where the user is).
  4. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    01 Jun 2017
    03 Nov 2009
    Link to this post
    Hi Elizabeth,

    Are you sure that the 3rd level items are bound, or are there any js erros? This js function is working without any problems.

    Can you send us a screen shot?

    You can use ExpandMode property to control the way the RadPanelBar expands/collapses. You can also control the initial expand/collapse of each item if you subscribe to ItemDataBound event (server side) or use the client - side events. I suggest that you go trough the RadPanelBar documentation to see what is best way for your case.   

    Best wishes,
    Nikolai
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered