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

Forums / Set-up & Installation / Sitemap page

Sitemap page

6 posts, 0 answered
  1. John
    John avatar
    3 posts
    Registered:
    16 Jun 2008
    30 Nov 2007
    Link to this post
    I'm attempting to create a sitemap page which displays both navigable and non-navigable pages. The default sitemap provider is obviously not working for this. I tried adding the AllPages provider which uses the same class and am still only seeing navigable nodes. Is there an easy way using the provider model to get both navigable and non-navigable nodes?
    Thanks,
    Brandon
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    30 Nov 2007
    Link to this post
    Hello John Skelly,

    The reason for this is that our CmsSiteMapProvider returns only the pages that are part of the navigation. Here is a possible approach to achieve the required functionality:
    1. Create a custom site map provider, that inherits from Telrik.Cms.Web.CmsSiteMapProvider
    2. Override GetChildNodes method of the base class to get all pages, both navigable and non-navigable
    3. Add your provider in the siteMap section of the web.config file, and set it as default provider; your siteMap section should look as follows:
    <siteMap defaultProvider="ModifiedSitemapProvider" enabled="true">  
          <providers> 
            <clear/> 
            <add name="CmsSiteMapProvider" description="Displays Cms Pages" type="Telerik.Cms.Web.CmsSiteMapProvider"/>  
            <add name="ModifiedSitemapProvider" description="Displays ALL Cms Pages" type="ModifiedSiteMapProvider" /> 
          </providers> 
        </siteMap> 

    ModifiedSitemapProvider is the type of your site map provider.

    Let us know if you need a further assistance.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. John
    John avatar
    3 posts
    Registered:
    16 Jun 2008
    30 Nov 2007
    Link to this post
    Thanks for the quick reply Pepi,

    This worked. However, I had to do a little more than just override the GetChildControls() method of the CmsSiteMapProvider. I also had to override the BuildSiteMap() and AddPageNode() methods to create the SiteMapNodeCollection so that I could get the child nodes. Does there happen to be an easier way to do this? Did the code base use the navigable="false" attribute in the past to return all nodes? I saw this being used in previous forum postings. Has this been deprecated? Thanks again!
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    04 Dec 2007
    Link to this post
    Hello John Skelly,

    Unfortunately, the functionality with navigable="false" is removed from Sitefinity and this cannot be used to get all pages (both navigable and non-navigable). So the solution is to implement your own provider and override all the  necessary methods.

    Greetings,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Diana
    Diana avatar
    16 posts
    Registered:
    26 Nov 2008
    20 Jan 2009
    Link to this post
    Hello,
      I was wondering if this solution still applies in the latest version of Sitefinity (3.5)?  I am creating a custom control in which I would also like to use the CMSSiteMapProvider to get access to pages that are marked as non-navigable. 

    If so, is there some code created that helps me understand what needs to go in the custom provider?

    Thank you,
    Diana
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    22 Jan 2009
    Link to this post
    Hello Diana,

    This is not changed in Sitefinity 3.5 SP1.
    We have an example on how to create such provider though. Please refer to the forum thread Sitemap and CMSSitemapProvider for more information about this.

    Regards,
    Georgi
    the Telerik team

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