You can name the file structure which can look like this:
|
# --- this is a sample webtree-structure file
|
|
index.phtml {
|
|
cookbook.phtml
|
|
plugins.phtml
|
|
webtree.phtml {
|
|
another-file.phtml
|
|
etc.phtml
|
|
}
|
|
}
|
Instead to call phtml with files, just call it like
|
% phtml -webtree structure
|
Following variables you can use within <def>-tag when you use plugin=inline language=perl.
| $child{$p} | comma separated sub-links, .phtml or .html as defined in structure-files. $p = 'root' top-most node |
| $parent{$p} | comma separated up-links |
| $next{$p} | link to next page (if one exists) |
| $prev{$p} | link to previous page (if one exists) |
| $title{$p} | gives you the html-title of the page, maybe you need to run phtml twice as the first past .html may not exist yet |
| $link{$p} | gives the html-link of the .phtml page |
|
Within your def-tags you can use this as example:
|
...
|
|
foreach my $c (split(/,/,$child{'index.phtml'})) {
|
|
# --- $c is the xyz.phtml of the top-level
|
|
print "<p><a href=\"$link{$c}\">$title{$c}</a>\n";
|
|
}
|
|
...
|
If you have no frontpage, but then use $child{'root'} for the
first-level nodes of the tree.
With a simple traverse-function (walking through $child{..} recursively) you can walk through the entire
tree, and as example, create pull-down menus as this site uses
on the left-side.
