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

Forums / Bugs & Issues / Sitepanelbar startingnodeoffset problem

Sitepanelbar startingnodeoffset problem

9 posts, 0 answered
  1. Jeff Sodeman
    Jeff Sodeman avatar
    13 posts
    Registered:
    20 Apr 2010
    08 Apr 2011
    Link to this post
    I have a sub-site running using a submain and domain mapping pointing to a folder within my SF page structure. The navigation is 3 levels deep.

    When I set the SitePanelBar startingnodeoffset to 0 it correctly shows all the pages in the sub-site. But when I change the offset to 1, which is what I really want, then the SitePanelBar shows nothing at all, regardless of the page that I try it from (1st level would be expected to be blank, but 2nd and 3rd are blank as well).

    I have a SitePanelBar set up with the exact same settings on the root site and it works fine.

    Is this a bug with it being a mapped domain?

    (I have StartFromCurrentNode = False, ShowStartingNode = True)
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 Apr 2011
    Link to this post
    Hello Jeff ,

    Please send the <urlMappings> section of your web.config, screenshot of the backend SiteMap Tree that represents the nodes you mapped and screenshot with the RadPanelBar settings.

    All the best,
    Ivan Dimitrov
    the Telerik team

  3. Jeff Sodeman
    Jeff Sodeman avatar
    13 posts
    Registered:
    20 Apr 2010
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Apr 2011
    Link to this post
    Hello Jeff Sodeman,

    Thank you for getting back to us.

    What you will need to do is the following:

    1) Open up the ~/Sitefinity/UserControls/Navigation35/SitePanelBar.ascx.cs and add the bellow piece of code to the user control:
    /// <summary>
    /// (Exposed from contained SitemapDataSource.) Gets or sets an URL
    /// of starting node that determines the root hierarchy that is
    /// exposed by the data source control.
    /// </summary>
    ///
    [WebEditor("Telerik.Cms.Web.UI.UrlEditorWrapper, Telerik.Cms")]
    [Browsable(true)]
    [Category("Navigation")]
    public string StartingNodeUrl
    {
        get
        {
            return this.SiteMapDataSource1.StartingNodeUrl;
        }
        set
        {
            this.SiteMapDataSource1.StartingNodeUrl = value;
        }
    }

    2) Create a template for each of your subdomains.

    3) On the template for your first subdomain add a SitePanelBar control click edit and set the StartingNodeUrl property to be the first page of your subdomain.

    Please note that those templates should be used only for their respective subdomains.

    Regards,
    Radoslav Georgiev
    the Telerik team

  5. Jeff Sodeman
    Jeff Sodeman avatar
    13 posts
    Registered:
    20 Apr 2010
    18 Apr 2011
    Link to this post
    Hi, thanks for the help.

    I've updated the panelbar with the code you provided (which in hindsight I'd had to add to the TreeNav months ago). But, even setting the StartingNodeURL (to ArcSite) if I put anything greater than 0 in for the offset, the whole menu is still empty. The panelbar shows "Parent Node" in the edit view. Screenshots attached.
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    20 Apr 2011
    Link to this post
    Hi Jeff Sodeman,

    Yes I see the problem. However I am not able to find a solution for it. Instead of using the offset can you try setting the starting node url to a deeper level?

    Best wishes,
    Radoslav Georgiev
    the Telerik team

  7. Jeff Sodeman
    Jeff Sodeman avatar
    13 posts
    Registered:
    20 Apr 2010
    20 Apr 2011
    Link to this post
    It would be hard to pull off, the client would have to add the panel and adjust the settings on each page, or we'd need a lot of templates to get that to work correctly.

    We had a similar problem with the treenav, but the startingnodeurl had fixed that. It's curious that it didn't work on the panel as well.

    If we can't get the panel working then I may just trying skinning the treenav to look like a panelnav if that's possible.
  8. Jeff Sodeman
    Jeff Sodeman avatar
    13 posts
    Registered:
    20 Apr 2010
    22 Apr 2011
    Link to this post
    You probably know this, but from messing with a few things it looks like the problem is probably with the site map provider.  Sadly I don't have access to the code used for that so I can't look any further.
  9. Jeff Sodeman
    Jeff Sodeman avatar
    13 posts
    Registered:
    20 Apr 2010
    22 Apr 2011
    Link to this post
    It's ugly but I found a way to get this working. Instead of using the SitePanelBar I put a plain SiteMapDataSource control on the masterpage that I'm using for my template, and connected it up a RadPanelBar.

    Then in the codebehind for the masterpage I do this to change the StartingNodeURL to get the same result as a nodeoffset:

    SiteMapProvider map = msSiteMapDataSource1.Provider;
     
    int depth = 0;
    SiteMapNode node = map.CurrentNode;
    while (node != null)
    {
        node = node.ParentNode;
        depth++;
    }
     
    node = map.CurrentNode;
     
    for (int i = 0; i < depth-2; i++) // 2 is the offset
    {
        node = node.ParentNode;
    }
     
    if (node == null) return;
     
    msSiteMapDataSource1.StartingNodeUrl = node.Url;
    msSiteMapDataSource1.DataBind();
Register for webinar
9 posts, 0 answered