Slaven Rezić > WE_Framework-0.097_03 > WE_Frontend::Plugin::Linear

Download:
WE_Framework-0.097_03.tar.gz

Dependencies

Annotate this POD

Module Version: 1.07   Source  

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 %]">&lt;&lt;</a>&nbsp;&nbsp;[% END -%]
  [% IF next -%]<a class="breadcrumb" href="[% next.relurl %]">&gt;&gt;</a>&nbsp;[% 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&auml;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.

AUTHOR ^

Slaven Rezic - slaven@rezic.de

SEE ALSO ^

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

syntax highlighting: