01 Oct 2001 03:55:19 UTC
- Distribution: HTML-WebMake
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (60 / 244 / 0)
- KwaliteeBus factor: 0
- 10.37% Coverage
- License: unknown
- Activity24 month
- Download (546.35KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
navtree.wmk - WebMake tag to generate a per-page sitemap
< use plugin="navtree" />
< navtree name=... sitemap=... opennode=... closednode=... thisnode=... thisleaf=... leaf=... depth=... />
This WebMake plugin provides the
navtreeoperates similarly to the
sitetreetag, but displays only a subset of all the site's nodes; it will map all of the top-level nodes of the site, the parent nodes of the current page, their direct children, and the current page plus it's children up to depth
depth. The effect is similar to a tree-view-based file browser, like Windows Explorer.
This differs from the
sitetreetag in that
sitetreedoes not support displaying the current page's children.
So, for a site like this:
- + Section 1
- + Section 2
A reference to the site tree on page
Section 1would result in a site tree like this:
Display of each page's entry in the tree is performed by expanding one of the 5 template content items named in the tag's attributes:
leaf. See the
sitemaptag documentation for more details on how to use these (note however that the is_node variable is not available for sitetrees).
The name of the sitetree object. To include a sitetree in a page, refer to it using this name, as a deferred reference.
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.
A content item which is evaluated to display a ''closed'' node, ie. a node which is not on the path to the current page.
A content item which is evaluated to display an ''open'' node, one which is on the path to the current page. As for the
nodeattribute, 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.
A content item which is evaluated to display an ''open'' root node. It defaults to
opennodeif not specified. It may be used to generate ''multirooted'' tree (a forest). In that case you should create a dummy root content (it upsets sitemap code if you dont have one single root) and create
rootnodetemplate to output only the list with apropriate decorations.
A content item which is evaluated to display the current page if it is an inner node, that is it has children. Iff
thisnodemust include a reference to the list variable.
A content item which is evaluated to display the current page if it is a leaf.
A content item which is evaluated to display a leaf-node page, one which has no pages beneath it in the hierarchy.
How many levels beneath the current page should be listed. 0 means none (behavior of
sitetreetag). The default is 1 which means to list direct children of the current node.
Following variables (content items) are defined for use in templates:
titlemetadatum of the node.
scoremetadatum of the node.
The name of the node.
The url of the node. Should be referenced using url reference (
The level of the node, that is how deep it is in the tree. Root node has level 0, it's children 1, their children 2 and so on.
The level under current page. This is similar to
level, except that current page is considered root. -1 for nodes not descendant from current page.
depthabove the current node and
depth - sublvlfor the descendants of the current node.
This is 1 for leaf nodes and 0 for inner nodes (both closed and open).
This is the list of children, which should be output by open nodes.
Thanks to Jan Hudec <bulb /at/ ucw.cz>, who provided this tag.
Module Install Instructions
To install HTML::WebMake, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install HTML::WebMake
For more information on module installation, please visit the detailed CPAN module installation guide.