
WE_Frontend::Plugin::Linear - assume hierarchy as a "linear" list

my $t = Template->new({PLUGIN_BASE => "WE_Frontend::Plugin"});
[% USE Linear %]
[% SET o = Linear.prev() %]
[% SET o = Linear.next() %]

This plugin assumes web.editor objects like linear pages as in books. The returned objects are WE_Frontend::Plugin::WE_Navigation::Object objects.
Get the previous object (or undef).
Get the next object (or undef).
Get the last object, probably by recursing into subdirectories.

Here's a usage example for the Linear plugin, creating back and forward links:
[% USE Linear -%] [% SET prev = Linear.prev -%] [% SET next = Linear.next -%] <noindex><!--htdig_noindex--> [% IF prev -%]<a class="breadcrumb" href="[% prev.relurl %]"><<</a> [% END -%] [% IF next -%]<a class="breadcrumb" href="[% next.relurl %]">>></a> [% END -%] <!--/htdig_noindex--></noindex>
Or for just creating a (multilingual) "next page" link:
[% USE Linear -%] [% SET next = Linear.next -%] [% IF next -%]<a class="navi" href="[% next.relurl %]"><img src="[% rooturl %]/images/arrow.gif" border="0"><noindex><!--htdig_noindex--> [% IF lang == "de" %]Nächste Seite[% ELSE %]Next page[% END %]: [% next.lang_title | html %]<!--/htdig_noindex--></noindex></a>[% END -%]
Note the presence of the noindex tags --- these help htdig to ignore the Next/Prev link text for the excerpts.

Slaven Rezic - slaven@rezic.de

Template::Plugin, WE_Frontend::Plugin::WE_Navigation, htdig(1).