<%@ sitemap/functions.pl %> <%@ lib/stdlib.pl %> <%@ lib/browser.pl %> <%-- This is the tricky bit in this template: because sitemap has got a tree structure, it needs to be processed recursively (well, could use a stack...) --%> <% sub print_recurse { my $document = shift; my $document_URI = $document->URI; my $document_Title = $document->Title; my @children = $document->Children; if (not defined $document->{Parent_ID}) { print_root ($document, @children); } elsif (@children) { if (sitemap_is_expanded ($document)) { print_expanded ($document, @children); } else { print_folded ($document); } } else { print_leaf ($document); } } %> <% sub print_leaf { my $document = shift; %>
  • <%= encode_html ($document->Title) %>
  • <% } %> <% sub print_folded { my $document = shift; %>
  • + <%= encode_html ($document->Title) %>
  • <% } %> <% sub print_root { my $document = shift; my @children = @_; %>
  • <%= $document->Title %>
  • <% } %> <% sub print_expanded { my $document = shift; my @children = @_; %>
  • - <%= $document->Title %>
  • <% } %> <%* foreach ($document->Ancestors) %><%= $_->Title %> : <%* end-foreach %><%= $document->Title %> : Sitemap

    <%= $document->Title %> : Sitemap

    You can expand and fold branches of the sitemap by using the plus [+] and minus [-] links.