NAME
WE_Frontend::Plugin::WE_Navigation::Object - object for WE_Navigation plugin
SYNOPSIS
Normally not instantiated.
DESCRIPTION
This is a specialization of WE_Frontend::Plugin::Navigation::Object. This class has additional methods for retrieving language titles, relative and absolute urls.
METHODS
- ext
-
Return default extension (by default ".html"). May be overwritten in a subclass.
- lang_title([lang])
-
The language dependent title.
lang
is optional. English will be used if other means to determine the language fail. - lang_short_title([lang])
-
Short title. (NYI)
- relurl
-
Return a relative URL to the object.
Use the name from NameDB if available. See also the
$IGNORE_NAME_DB
variable to turn this feature of.If the object is an folder, then the
IndexDoc
doc is used instead for the URL. IfIndexDoc
is undefined, then theautoindexdoc
feature handling fires. This feature may be turned off by$DONT_USE_INDEXDOC
. - halfabsurl
-
Return a half-absolute URL (without scheme, host and port part) to the object.
- absurl
-
Return an absolute URL (with scheme, host and port part) to the object.
- target
-
Return the window target to the object. Currently this is always "_self".
-
Return true if the object should be included to the navigation. The following cases cause the object to be excluded from the navigation:
The object's attribute
Release_State
is notreleased
The object's attribute
Navigation
ishidden
The object is not ready to be published as determined by
TimeOpen
andTimeExpire
. The current date can be adjusted by setting thelocalconfig.now
template variable to a unix epoch time.
- obj_proxy($caller)
-
Some objects may not have content of their own and use the first child in their collection instead for getting attributes like Title etc. By default, this method just returns the object itself, but may be overriden. See
WE_Frontend::Plugin::WE_Navigation
for an example.$caller
will be set to a symbolic name of the caller:title
(for methods likelang_title
),url
(for methods likerelurl
), ornavigation
) (forinclude_in_navigation
and similar methods). If you need the real caller function name, then use the standardcaller
function. - version_proxy($caller)
-
For a given object, determine which version of the object should be used. The default implementation of version_proxy is to return the last released version (using get_released_object from WE::DB::Obj), or, if no object is released, the latest version. Subclasses are free to override this method.
GLOBAL VARIABLES
- $IGNORE_NAME_DB
-
If set to a true value, then do not use the name database in relurl.
- $DONT_USE_INDEXDOC
-
If set to a true value, then neither use the
IndexDoc
nor theautoindexdoc
features.
EXAMPLES
Here are some examples for using this plugin in templates:
[% USE n = WE_Navigation -%]
[% FOR p = n.siblings -%]
[% IF p.include_in_navigation -%]
<a href="[% p.relurl | html %]">[% p.lang_title | html %]</a><br />
[% END -%]
[% END -%]
HISTORY
From version 1.11 the relurl and related methods handle the IndexDoc value of folders and in absence of this value look at the autoindexdoc feature.
From version 1.09 the relurl and related methods prefer to construct a symbolic URL with the help of the NameDB. Older versions always constructed an URL using the numerical id.
AUTHOR
Slaven Rezic - slaven@rezic.de