Mounting sitemaps
One of the most useful concepts of the Paloose/Cocoon sitemap is the ability to "divide and conquer". It is possible for a
sitemap to invoke another "sub" sitemap and transfer control to it. There is a certain amount of inheritance of components so that
they do not have to be redefined. Although this does not preclude having extra components defined in the subsitemaps. Subsitemaps
allow a hierarchy or tree of sitemaps underneath the master sitemap. The advantage of this is that a site with several different
areas can be developed separately using a sitemap for each area, making larger sites easier to maintain. The master sitemap
controls which sitemap is used dependent on the request.
<map:match pattern="/documentation/*.html">
<map:mount uri-prefix="documentation" src="/documentation/sitemap.xmap"/>
</map:match>
The attributes are similar to those used in Cocoon
- src — the file name of the subsitemap. If src ends is a
path separator (for example "/") then the filename sitemap.xmap will be added, otherwise the defined
filename will be used.
- uri-prefix — defines the part of the request URI that should be removed when passing
the request into the subsitemap. For example using the mount element above if the requested URI was "documentation/sitemap.html" then "documentation/" would be removed from the request
passed to the subsitemap (documentation/sitemap.xmap). Note that the trailing path separator is
removed as well. As far as I can see Cocoon insists on this attribute being
present (but can be an empty string). Paloose makes this attribute optional.
Note
Performance note: there will be a performance penalty if subsitemaps are nested too deep.
Copyright 2006 – 2023 Hugh Field-Richards. All Rights Reserved.