h1. Javascript for Navigation and Sitemap

h2. Navigations Object

You always have a JSON object of navigation: eXo.env.portal.navigations. It contains all data of site's navigation.

    * Each portal has 3 types of navigation: Portal navigation, Group navigation and User navigation. Thus navigation object has 3 childrens.
    * Each type of navigation has nodes property, it contains all navigation nodes of that navigation type.
    * Each navigation node has following properties:
          ** uri (String) : Navigation node's URI.
          ** icon (String): Navigation node's icon.
          ** visible (Boolean): A navigation node can be visible or invisible. If visible, it can be shown in navigation.
          ** resolvedLabel (String): Navigation node's label.
          ** name (String): Navigation node's name.
          ** children (Object): Navigation node's children.

h2. Get Current Navigation Node Function

*getCurrentNavigationNode(navigations, selectedNodeUri)* function:

You also have a function to get selected navigation node object. In this function, navigations is eXo.env.portal.navigations, and selectedNodeUri is an URI of selected navigation node, you can get it from eXo.env.portal.selectedNodeUri (e.g. "/home/yourPage"). You can use this function to change some styles for the selected navigation node.

h2. Navigation or Sitemap Creation

Define your own *renderNavigations()* function or *renderSitemap()* function by using *eXo.env.portal.navigations* and put it in default.js of navigation web content.