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

Forums / Developing with Sitefinity / sitemap page in website

sitemap page in website

4 posts, 0 answered
  1. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    05 Sep 2008
    Link to this post

    Hi

    I have used a treeview control to generate the site map of a website
    however, some of the pages are set not to appear in the navigation for asetical reasons.

    I need to allow for all pages to show in the treeview (regardless of whether its set to appear in the site map or not)....is this possible?

    For future reference, it would be worth having 2 types of "dont show in navigation" and on the navigation control you choose if to include them or not as a property.

    thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Sep 2008
    Link to this post
    Hi Quade,

    Thank you for your question.

    Setting Show in navigation property to "No" removes the page from the SiteMap. That is the reason why
    you cannot display the page in the SiteTreeview control. A possible solution is setting Show in navigation to "Yes" and hide the desired pages from the navigation control you use. Here is a simple example that we created for the SiteMenu navigation control located under  ~\[yourproject]\Sitefinity\UserControls\Navigation\SiteMenu.ascx.cs

      public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e) 
        { 
            if (e.Item.Text.ToLower() == "mypage"
            { 
                e.Item.Visible = false
            } 

    "mypage" will be hidden from the Sitemenu and will be shown in the SiteTreeview control. You can achieve the same functionality for other pages and navigation controls.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Jon
    Jon avatar
    1 posts
    Registered:
    16 Sep 2008
    16 Sep 2008
    Link to this post
    How do you target pages within groups and subpages?

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    17 Sep 2008
    Link to this post
    Hi Jon,

    Sitefinity provides CmsSiteMapNode class that has a property which gets/sets the type of the page. Here is an example how to check if the page is of type Group Page:

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

    Let us know if this helps.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered