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

Forums / Developing with Sitefinity / URL Mapping and Panelbar issue

URL Mapping and Panelbar issue

9 posts, 0 answered
  1. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    17 Jun 2010
    Link to this post
    Hi guys and gals,

    I hope this is an easy fix.  I have setup url mapping to use a subdomain for one of my departments.

    Ie you would type athletics.schoolsite.com instead of www.schoolsite.com/athletics/default.aspx.

    It is working perfectly however, I am using a panelbar navigation on the left hand side and if I type in the whole url
    (www.schoolsite.com/athletics/default.aspx) the panel bar shows up just fine and all the links work great.  But if I type in athletics.schoolsite.com  the panelbar links are gone so I have no navigation on the page.

    It appears as if the panelbar cannot interpret the subdomain even though technically it is a directory on the site.

    Any help is appreciated.  I can  provide working links and screenshots if need be.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Jun 2010
    Link to this post
    Hi bleutiger,

    For the panel bar on your sub domain pages, can you try setting its StartingNodeUrl property to start from your sub domain home page instead of the sitemap root.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    18 Jun 2010
    Link to this post
    There is no way to set the starting node in the properties.  You can set usiing the current node as the start to either true or false is that what you are talking about?
  4. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    22 Jun 2010
    Link to this post
    Ok so I found another post that gave me a piece of code to add to the sitepanel bar and will allow me to add a starting node url  but now I have another issue.

    if I am on the athletics.schoolsite.com subdomain  the first link in the sitepanel doesnt have a page name it simply has

    athletics.schoolsite.com/.aspx

    instead of athletics.schoolsite.com/default.aspx

    I have double checked and republished the page making sure that the page name is in the properties of the page but no joy.

    Any takers on this.
  5. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    22 Jun 2010
    Link to this post
    Another interesting development here...

    If i am on the subdomain of athletics.schoolsite.com and log in to the  backend dashboard and go to view that page I get this error

       

    Server Error in '/' Application.

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /.aspx


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053


    but if I look at it when I am logged into the www.schoolsite.xxx than everyhting appears as it should and the page is just fine.

    I even tried making a copy of the page so I could start over but still has the same issue.

  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Jun 2010
    Link to this post
    Hi bleutiger,

    Could you attach a screenshots that represents the group pages of the SiteMap ( Pages section of the backend), page that has been set as starting node for the SitePanelBar and paste the web config setting for <urlMappings>

    <urlMappings>
      <add key="host1" value="" shared="true" />
      <add key="host2" value="Sub2" shared="true" />
    </urlMappings>

    It is possible that the RadPanelBar control has not been populated properly from the datasource, because of the url mapping.

    The easiest and quick fix is to expose a public property where you will type the root node url. ( say default.aspx) and set it as NavigateUrl of the problematic RadPanelItem. You can set the NavigateUrl inside ItemDataBound event of the RadPanelBar.

    public string StartingNodeFullUrl
    {
        get
        {
            return this._StartingNodeFullUrl;
        }
        set
        {
            this._StartingNodeFullUrl = value;
        }
    }
     
    private string _StartingNodeFullUrl;
     
     
    public void RadPanelbar1_ItemDataBound(object sender, RadPanelBarEventArgs e)
    {
        CmsSiteMapNode cmsNode = e.Item.DataItem as CmsSiteMapNode;
        // you have to use some identifier here
        if (e.Item.NavigateUrl.Equals(".aspx"))
        {
            e.Item.NavigateUrl = StartingNodeFullUrl;
        }
    }


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    24 Aug 2010
    Link to this post
    Ivan sorry for the really delayed response to this.  I was called away on another project...actually several.

    I am copying my url mapping as requested.

    <urlMappings>
                    <add key="athletics.lcisd.org" value="athletics/default" shared="true" />
                    <add key="es.lcisd.org" value="Espanol/default" shared="true" />
                </urlMappings>


    here is the itemDataboundmethod that is currently there.

    I dont want to mess up how it works when I am not on a sub domain so can you help me modify it..

    public void RadPanelbar1_ItemDataBound(object sender, RadPanelBarEventArgs e)
       {
           if (this.hideUrlForGroupPages)
           {
               CmsSiteMapNode node = e.Item.DataItem as CmsSiteMapNode;
               if (node != null && node.PageType == CmsPageType.Group)
               {
                   e.Item.NavigateUrl = "";
               }
           }
       }


    I added your new private and public strings to the properties region in the SitePanelbar.ascx.cs page in the Sitefinity/Usercontrols/Navigation35 folder...is that correct?
  8. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    27 Aug 2010
    Link to this post
    Ok...still need help with this.

    This is what I added to the cs page
    /// <summary>
    /// (Exposed from contained RadPanelbar.) Gets or sets the skin used by
    /// RadPanelbar.
    /// </summary>
    /// <value>
    /// A
    /// <a onclick="javascript:navigateToHelp2Keyword('frlrfSystemStringClassTopic','System.String')" href="#">String</a> specifying the skin. The default value is empty string
    ///    ("").
    /// </value>
    /// <remarks>If the value is empty string ("") no skin is used.</remarks>
    [Browsable(true)]
    [Category("Appearance")]
    public string Skin
    {
        get
        {
            return this.RadPanelbar1.Skin;
        }
        set
        {
            this.RadPanelbar1.Skin = value;
        }
    }
    public string StartingNodeFullUrl
    {
        get
        {
            return this._StartingNodeFullUrl;
        }
        set
        {
            this._StartingNodeFullUrl = value;
        }
    }
    private string _StartingNodeFullUrl;
    #endregion
    #region Methods
    /// <remarks>
    /// The event handler is used to enable the feature of hiding the url for a group
    /// page PanelItem. The type of the page corresponding to the current node is checked and
    /// if it is a group page, the url for the CmsSiteMapNode is set to an empty string.
    /// </remarks>
    /// <summary>
    /// A handler for the <strong>RadPanelbar</strong> ItemDataBound event. Performs
    /// hiding of URLs for group pages, if the <strong>HideUrlForGroupPages</strong> property
    /// is <strong>true</strong>.
    /// </summary>
    /// <param name="sender">The object that caused the event.</param>
    /// <param name="e">
    /// An instance of the RadPanelbarEventArgs class containing information about the
    /// event.
    /// </param>
    public void RadPanelbar1_ItemDataBound(object sender, RadPanelBarEventArgs e)
    {
        CmsSiteMapNode cmsNode = e.Item.DataItem as CmsSiteMapNode;
        if (e.Item.NavigateUrl.Equals(".aspx"))
        {
            e.Item.NavigateUrl = StartingNodeFullUrl;
        }
        if (this.hideUrlForGroupPages)
        {
            CmsSiteMapNode node = e.Item.DataItem as CmsSiteMapNode;
            if (node != null && node.PageType == CmsPageType.Group)
            {
                e.Item.NavigateUrl = "";
            }
        }
    }
    #endregion



    It still does the same thing.  Am I not adding it correctly.  Really need some help here.
  9. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    31 Aug 2010
    Link to this post
    Hi bleutiger,

    We have responded in your support ticket. Please find our answer bellow:

    The problem you are experiencing is because you have mapped your subdomain to the first child page of a group page, and you are setting the starting node url of the page to be the page's parent. You can change the url as you whish when the site panel bar is being bound:
    public void RadPanelbar1_ItemDataBound(object sender, RadPanelBarEventArgs e)
    {
        var node1 = SiteMap.CurrentNode as CmsSiteMapNode;
        if (node1 != null)
        {
            var item = e.Item.DataItem as RadPanelItem;
            if(e.Item.NavigateUrl.Equals("~/.aspx"))
            {
                e.Item.NavigateUrl = "~/default.aspx";
            }
        }
        if (this.hideUrlForGroupPages)
        {
            CmsSiteMapNode node = e.Item.DataItem as CmsSiteMapNode;
            if (node != null && node.PageType == CmsPageType.Group)
            {
                e.Item.NavigateUrl = "";
            }
        }
    }

    However the whole problem arises from the way your sub-domain pages are mapped. If you intend on using group type of pages you should map to the group page, however if the first child page of the sub-domain is named default you will have redirection problems. The other option is to use normal pages for the top level sub-domain page.



    Regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
9 posts, 0 answered