Navigational

Do I have to use navigational macros in my site?

Not necessarily. By default Elephant already includes all navigation elements in its templates. Navigational macros are intended for special formatting purposes. Navigational macros do not include CSS especial notations, thus you use your own.

Listing macros or hard written links?

Both choices may have the result. Main difference is that listing macros will update their content based on current configuration.

Navigation
Macro parser

Renders a bread crumbs navigator as an HTML unordered list.

{@ navigator : location }
Attributes Description Options Default
location Navigator mode.

Renders a traversal navigator as an HTML table with three columns.

{@ navigator : traversal [ : show-title ] }
Attributes Description Options Default
traversal Navigator mode.
show-title When true, renders context name as well. false

Renders a menu as HTML unordered list. level tells starting at which level options are shown. preloaded indicates how many children are to be shown.

{@ navigator : options : decorators : level : preloaded [ : show-current ] }
Attributes Description Options Default
options Navigator mode.
decorators When true, aditional DIVs are added at top and bottom.
level Number of the item level.
preloaded Number of preloaded children.
show-current When true, children passing preloaded value will show along with ancestors and siblings, as opposed to not showing any child with level over level + preloaded. true

Renders a tabulator as HTML unordered list. level tells at which level tabs are shown.

{@ navigator : tabulator : level }
Attributes Description Options Default
tabulator Navigator mode.
level Number of the item level.

Renders a web map.

{@ webmap [ : level ] }
Attributes Description Options Default
level Tells until which level contexts are shown. 1

Renders a list of selectable contexts.

{@ list : behavioural_keywords [,behavioural_keywords...] : navigational_keywords [,navigational_keywords...] : selection_keywords [,selection_keywords...] }
Attributes Description Options Default
behavioural_keywords Keywords controlling how information displays. popup, external, hidden, verbose
navigational_keywords Keywords to navigate Elephant contexts. parent, locate, level, root, match
selection_keywords Keywords actually returning contexts. all, siblings, search, children, self, leaf, ancestors

Renders a line of selectable contexts.

{@ anchor : behavioural_keywords [,behavioural_keywords...] : navigational_keywords [,navigational_keywords...] : selection_keywords [,selection_keywords...] }
Attributes Description Options Default
behavioural_keywords Keywords controlling how information displays. popup, external, hidden, verbose
navigational_keywords Keywords to navigate Elephant contexts. parent, locate, level, root, match
selection_keywords Keywords actually returning contexts. all, siblings, search, children, self, leaf, ancestors

Understanding what behavioural keywords are

Behavioural keywords stand for keywords controlling how information displays. The way behaviours will extend in future versions might be controlled in this section.

Behavioural keyword

Description

verbose

Writes the whole path to context, starting from current context.

popup

Popup effect on resulting links is to open a popup instead of opening a new context.

hidden

Hidden contexts will show, even if protected.

external

Links will open on a new tab or window.

Understanding what navigational keywords and selection keywords mean


Navigational keywords end up as a list, colon separated, of keywords pointing to existing contexts. As starting point, path_to_contexts initializes to current context, that is, the web page where macro displays.

Here comes a brief description of what each keyword does and after some clear examples:

Navigation keywords move current selection from context to context.

Navigation keyword

Description

parent

Moves to current selection's parent

root

Moves to root context

level

Moves to ancestor[level]

locate

Moves next token path, expands * to current path

match

Moves to matching context from current selection using regular expressions

Selection keywords actually return contexts, one or several. A zero results it's considered an error an macro will displays with m_error class, which defaults to red color and a warning image. Otherwise, macro expands into m_list class.

Render keyword

Description

self

Returns current selection

children

Returns current selection's children

all

Returns all descendant contexts

leaf

Returns all descendant contexts having no children

ancestors

Returns current selection's ancestors

siblings

Returns current selection's siblings, including itself

search

Returns matching contexts from current selection

Learning by example

Macro

Description

{@list:self}


{@anchor:self}
Navigational
{@anchor:popup:self}
Navigational

self returned current selection which defaults to current context, popup shows this page as a popup window

{@list:parent:children}


{@anchor:parent:children}
[ Core, Navigational, Modules, Documentation, Macro summary ]

parent took us into current context its parent, while children returned a list of its children

Printer version
English06/08/11 18:02Lluís Turró Cutiller
English08/08/13 10:32Lluís Turró Cutiller
English01/08/18 10:18Lluís Turró Cutiller
English03/25/20 07:40Lluís Turró Cutiller
English03/25/20 09:48Lluís Turró Cutiller
English09/15/20 07:34Lluís Turró Cutiller