Table of contents
Sitemap and Breadcrumbs
Castle Anakia is able to generate a site map and breadcrumbs automatically for the site based on the object model created to reflect the physical structure of the content files.
The generated sitemap
The sitemap will be a xml documented with nodes reflecting the structure. You can use XPath to select slices of the document to show.
To exemplify how it works, suppose you have the following structure.
[castle] index.xml sitemap.xml [activerecord] index.xml
The sitemap generated to this structure follows. Notice that the sections within the content file are present as long as they have an id.
<sitemap> <castle level="1" page="index.html" title="Main Page" path="castle"> <section id="introducingcastle" title="Introducing Castle" page="index.html" level="1" /> <section title="Meet our projects" page="index.html" level="1" /> <section id="newsandannouncements" title="News & Announcements" page="index.html" level="1" /> <section id="license" title="License" page="index.html" level="1" /> <section title="Thanks" page="index.html" level="1" /> <sitemap level="1" page="sitemap.html" title="Castle Site Map" issubpage="true" path="castle"> <section title="Site Map" page="sitemap.html" level="2" /> </sitemap> <activerecord level="2" page="index.html" title="ActiveRecord" path="castle/activerecord"> <section id="WhyWouldIUseIt" title="Why would I use it?" page="index.html" level="2" /> <section id="WhyWouldINotUseIt" title="Why would I not use it?" page="index.html" level="2" /> </activerecord> </castle> </sitemap>
Breadcrumbs
A list of breadcrumbs is made available for your NVelocity template. The first item represents the root page followed by the pages (index.xml pages) navigated until the current page is reached. This is a static list, not dynamically.
The following NVelocity snippet prints the breadcrumbs used in this site
#set($bcount = $breadcrumbs.Count) #if($bcount > 1) <div class="breadcrumbs"> #foreach($b in $breadcrumbs) » <a href="#getrelativelevel()$b.RelativePath">$b.Title</a> #end </div> #end