sitetree.wmk
< use plugin="sitetree" />
< sitetree name=... sitemap=...
opennode=... closednode=...
thispage=... leaf=... />
This WebMake Perl library provides the sitetree tag.
Sitetree operates similarly to the built-in sitemap tag, but, displays only a subset of all the site's nodes; it will map all
of the top-level nodes of the site, and then only the parent nodes of the
current page. The effect is similar to a tree-view-based file browser, like
Windows Explorer.
In terms of differences in usage, where sitemap creates a single map which includes every page in the site, sitetree maps only the pages up to and including the current page, and generates a
map for each individual output page.
So, for a site like this:
-
+ Section 1
-
-
+ Section 1 Subsection 1
-
-
+ Section 1 Subsection 2
-
-
+ Section 2
-
-
+ Section 2 Subsection 1
-
-
+ Section 2 Subsection 2
-
A reference to the site tree on page Section 1 Subsection 1 would result in a site tree like this:
-
- Section 1
-
-
- Section 1 Subsection 1
-
-
+ Section 2
-
Display of each page's entry in the tree is performed by expanding one of
the 4 template content items named in the tag's attributes: closednode,
opennode, thispage, or leaf. See the sitemap tag documentation for more details on how to use these (note however that
the is_node variable is not available for sitetrees).
-
name
-
The name of the sitetree object. To include a sitetree in a page, refer to
it using this name, as a deferred reference.
-
sitemap
-
The name of the sitemap. The sitetree requires a sitemap, as the sitemap is
responsible for mapping out the site and defining which pages and content
items are included.
-
closednode
-
A content item which is evaluated to display a ''closed'' node, ie. a node
which is not on the path to the current page.
-
opennode
-
A content item which is evaluated to display an ''open'' node, one which is
on the path to the current page. As for the sitemap tag's node attribute, this content item must include a reference to the list variable, which will contain all the entries for the pages beneath it in
the hierarchy.
-
thispage
-
A content item which is evaluated to display the current page.
-
leaf
-
A content item which is evaluated to display a leaf-node page, one which
has no pages beneath it in the hierarchy.
Thanks go to Alex Canady, who came up with the idea for this one.
|