5.2.3.
Constructing the sitemap
Up one level
The sitemap is constructed using the same mechanisms as the navigation tree - it simply uses a different query builder and navtree strategy.
The view that is used by the sitemap.pt page template is found in CMFPlone.browser.sitemap.SitemapView, and implements CMFPlone.browser.interfaces.ISitemapView. It in turn delegates to the more general view CMFPlone.browser.navigation.CatalogSiteMap which implements CMFPlone.browser.interfaces.ISitemap. This does:
def siteMap(self):
context = utils.context(self)
queryBuilder = SitemapQueryBuilder(context)
query = queryBuilder()
strategy = getMultiAdapter((context, self), INavtreeStrategy)
return buildFolderTree(context, obj=context, query=query, strategy=strategy)
Note that the sitemap and navtree query builders and strategies share much code and are derived from one another.
There is a utilty method in CMFPlone.utils called createSiteMap() that invokes the ISitemap view. The deprecated way of constructing the sitemap is through a call to PloneTool.createNavTree setting sitemap=True.