Cheetah.Tools.SiteHierarchy module

Create menus and crumbs from a site hierarchy.

You define the site hierarchy as lists/tuples. Each location in the hierarchy is a (url, description) tuple. Each list has the base URL/text in the 0 position, and all the children coming after it. Any child can be a list, representing further depth to the hierarchy. See the end of the file for an example hierarchy.

Use Hierarchy(contents, currentURL), where contents is this hierarchy, and currentURL is the position you are currently in. The menubar and crumbs methods give you the HTML output.

There are methods you can override to customize the HTML output.

class Cheetah.Tools.SiteHierarchy.Hierarchy(hierarchy, currentURL, prefix='', menuCSSClass=None, crumbCSSClass=None)

The home>where>you>are crumbs


When you are at the homepage


An indented menu list