The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WE_Frontend::Plugin::WE_Navigation - specialized navigation plugin

SYNOPSIS

    [% USE n = WE_Navigation %]
    [% USE n = WE_Navigation(objid = 12) %]

DESCRIPTION

WE_Frontend::Plugin::WE_Navigation is a subclass of WE_Frontend::Plugin::Navigation. Instead of WE_Frontend::Plugin::Navigation::Object as underlying objects, it uses WE_Frontend::Plugin::WE_Navigation::Object objects.

The following global Template variables are used additionally:

lang

Current language, if the lang parameter is not defined in the WE_Frontend::Plugin::Navigation::Object methods lang_title, lang_short_title, halfabsurl and absurl. If lang is not set, then usually "en" will be used instead.

config

The WE_Frontend::Info object, also known as WEsiteinfo object. This is used to get absolute URLs for the halfabsurl and absurl methods.

localconfig

To pass other parameters, use the localconfig variable. For now, the localconfig.now is used for determining the current time for time based publish processes.

USE YOUR OWN SUBCLASSES

Here is an example for an own subclass derived from WE_Frontend::Plugin::WE_Navigation:

    package WE_Sample::Plugin::MyNavigation;
    use base qw(WE_Frontend::Plugin::WE_Navigation);

    sub Object {
        "WE_Frontend::Plugin::MyNavigation::Object";
    }

    package WE_Sample::Plugin::MyNavigation::Object;
    use base qw(WE_Frontend::Plugin::WE_Navigation::Object);

    sub obj_proxy {
        my $self = shift;
        # put your definition here
        if ($self->o->is_folder) {
            # return first child of folder
            ...
        } else {
            $self;
        }
    }

    sub relurl {
        # put your definition here
        ...
    }

    1;

This could be put into a file called WE_Sample/Plugin/MyNavigation.pm. Now you can override methods in the WE_Sample::Plugin::MyNavigation::Object class.

EXAMPLE USAGE IN TEMPLATES

To get the modification time of the current page:

    [% USE n = WE_Navigation -%]
    Modified time: [% n.self.o.TimeModified %]

Note that "self.o" return a WE::Obj object.

AUTHOR

Slaven Rezic - slaven@rezic.de

SEE ALSO

WE_Frontend::Plugin::Navigation, WE_Frontend::Plugin::WE_Navigation::Object.