Managing navigation bars
Out of the box, Jifty comes with a top navigation bar which by default contains a Home entry pointing to the root url of your application. If you have the AdminMode turned on, two more entries will reside in the top level menu: Administration and Online Docs. With AdminMode turned off, these two items will disappear. You can always access the top menu by accessing Jify->web->navigation() and then do any kind of modification to the object returned by this call.
Additionally you may specify any number of additional menu bars based on Jifty::Web::Menu objects. One such bar is already there if you need it. Simply access Jifty->web->page_navigation() to create an additional navigation bar on the fly.
Every menu bar may consist of a nested tree-like structure that represents a full-fledged navigation tree.
The default navigation bar is populated in the template _elements/nav that is rendered during the wrapper template's execution. To generate an application-wide visible navigation bar, either override this template in your application or put some logic into the dispatcher. The latter method will give you no way of eliminating the Home entry.
Populating a navigation menu
Inside a Jifty::Web::Menu object Jifty keeps a hash with all children of that item (if any). Every child is an object of the class Jifty::Web::Menu again. To specify the sort order, every object keeps its own sort_order as a parameter that will used while rendering to sort the items into the right order. If you do not specify the sort order, Jifty assumes an ascending sort and will assign the current number of children as the sort order for the newly created item. If you plan to have items always sorted towards the end, you could simply specify high-enough numbers as a sort order for the items in question.
Sample code:
my $nav = Jifty->web->navigation();
my $first = $nav->child("first", label => 'first item', url=>'/page1.html');
$first->child("one", label => 'one', url => '/link.html');
$first->child("two", label => 'two', url => '/link.html');
$first->child("three", label => 'three', url => '/link.html');
my $second = $nav->child("second", label => 'second item', url => '/page2.html');
$second->child("four", label => '444', url => '/link.html');
$second->child("five", label => '555', url => '/link.html');
$second->child("six", label => '666', url => '/link.html');
Currently the second-level entries (constructed via child) are not shown hierarchically. Depending on the current URL, however, the right entry will be displayed highlighted.
Page navigation
Aside from the global navigation entry there is another, page_navigation that allows the same settings as navigation does but is not currently used in any Jifty-provided template elements. You may use it as any sub-navigation on individual pages.