redaxo/redaxo — Issue #18: RFC RecursiveIterator in rex_navigation
Author: staabm
Created: 2011-11-27 11:27:54+00:00
State: open

RFC / Request for comments. Ths issue is meant to discuss a feature which may be added in a future redaxo version...

The rex_navigation should be adjusted for easier use and a more convenient way to generate custom markup.

$navigation = new rex_navigation();
$navigation->ignoreOfflines(true);
$navigation->ignoreStartArticles(true);
foreach($navigation->getLevel($fromLevel, $toLevel) as $navElement)
{
$navElement interface:
getLevel(), returns the level as int
getPosition(bool $asNumeric) returns the position of the element within its level as string (first/last/1,2,3,4,...)
getGlobalPosition(bool $asNumefic) returns the position of the element within the whole structure as string (first/last/1,2,3,4,...)
hasChildren() returns true when the item has children, otherwise false
}