title: Generate hierarchy
linktitle: hierarchy.py
parent: Plugins
+lang: en
ctime: 2009-06-26
+mtime: 2009-06-26
This is one of the more complex plugins, used to generate menus and
breadcrumbs. For this, it reads certain keyword from the
= Generation of a side-menu =
This again is done via a suitable [[template_mako]]. The
-template uses the function "`get_sidemenu()`" and returns (level,
+template uses the function "`get_sidemenu()`" which returns (level,
part_of_path, is_current, title, link) tuples. Again all links are relative
to the calling page.
-* "`level`" is the indendation level, starting with 0. You can use this for
+* "`level`" is the indentation level, starting with 0. You can use this for
CSS "`id=`" or "`class`" attributes
* "`part_of_path`" is a flag telling you if the mentioned page is part
of your path, i.e. if the specified page is in the breadcrumbs.
* "`title`" is the full title for the page
* "`link`" is the relative URL to the page
-Here's a sample Mako template excerpt that converts this into a HTML menu:
+Here's a sample [[Mako template|template_mako]] excerpt that converts
+this into a HTML menu:
<ul id="sidebar">
% for level, part_of_path, current, page, link in get_sidemenu():
this:
<%
- site = get_sitemap()
+ site = get_linear_sitemap()
%>
<ul>
% for level, page, link in site:
with some more advanced Mako template magic:
<%
- site = get_sitemap()
+ site = get_linear_sitemap()
lvl = -1
%>
% for level, page, link in site: