NAME
WE_Frontend::Plugin::Linear - assume hierarchy as a "linear" list
SYNOPSIS
my $t = Template->new({PLUGIN_BASE => "WE_Frontend::Plugin"});
[% USE Linear %]
[% SET o = Linear.prev() %]
[% SET o = Linear.next() %]
DESCRIPTION
This plugin assumes web.editor objects like linear pages as in books. The returned objects are WE_Frontend::Plugin::WE_Navigation::Object objects.
METHODS
- prev()
-
Get the previous object (or undef).
- next()
-
Get the next object (or undef).
- last()
-
Get the last object, probably by recursing into subdirectories.
EXAMPLES
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 contentfor the excerpts.
AUTHOR
Slaven Rezic - slaven@rezic.de
SEE ALSO
Template::Plugin, WE_Frontend::Plugin::WE_Navigation, htdig(1).