WE_Frontend::Plugin::WE_Navigation - specialized navigation plugin
[% USE n = WE_Navigation %] [% USE n = WE_Navigation(objid = 12) %]
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:
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.
lang
lang_title
lang_short_title
halfabsurl
absurl
The WE_Frontend::Info object, also known as WEsiteinfo object. This is used to get absolute URLs for the halfabsurl and absurl methods.
WEsiteinfo
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.
localconfig
localconfig.now
Here is an example for an own subclass derived from WE_Frontend::Plugin::WE_Navigation:
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.
WE_Sample/Plugin/MyNavigation.pm
WE_Sample::Plugin::MyNavigation::Object
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.
Slaven Rezic - slaven@rezic.de
WE_Frontend::Plugin::Navigation, WE_Frontend::Plugin::WE_Navigation::Object.
To install WE::DB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WE::DB
CPAN shell
perl -MCPAN -e shell install WE::DB
For more information on module installation, please visit the detailed CPAN module installation guide.