getnav function
{getnav} returns menu hierarchy data in the requested format with the requested items and assigns it to a variable. This is typically used in menus or other navigation displays. The 'type' of data returned is:
- parent - the parent of the passed item which is 'of'
- siblings - items at the same depth as the passed item
- children - items of one-level greater depth than the passed item
- siblingsandchildren - items at the same or one-level greater depth than the passed item
- siblingsandallsubchildren - items at the same or greater depth than the passed item
- allsubchildren - items at a greater depth than the passed item
- haschildren - flag as to whether passed item has children
- hierarchy - the entire menu/page hierarchy in either the YUI format or if 'notyui' is set, in a standarded nested list.
- default - return all pages in a single dimension array.
If 'json' is set, data is returned in JSON format.
If 'assign' is set, data is assigned to that variable.
If 'showtop' is set, the top level menu is also returned.
If 'parents' is set, the parent of the passed item is also returned.
{getnav type=siblingsandchildren of=$current->id parents=1 assign=children}
Loading Help