Navigation API

Last edited: 3/30/2020

Also see: Navigation Overview

Display mode: dropdown

This display mode will output a nested UL of all nav items. A class of current is added to the LI of the page the user is currently viewing. This works in most cases but does not when the nav points to something outside of the nav structure. For example a link to a blog might be listed anywhere in the nav, but will take the user to example.com/blog-slug/. In this case the current label cannot be applied.

Tags

show

Show tags are entirely optional. The show tags will replace the content inside of each <li>. The <ul> and <li> tags will remain in place keeping the hierarchy of the navigation accurate and in place.

Tag Description
__title__ The title of the nav item.
__url__ The url of the nav item.
__pageid__ The id of the linked page.
__pagetitle__ The title of the linked page.
__pageslug__ The slug of the linked page.
__description__ The description of the linked page.
__id__ This is a unique id of the nav item. This id is already automatically inserted as the id of the <li>
__ifnewwindow__ Returns a space (" ") if the link is set to open in a new window, and nothing if not. This should be included on its own line followed by the markup to output if the link is set to open in a new window. For example, show:__ifnewwindow__target="_blank" will only be output for links set to open in a new window.
__level__ The level of the nav item. Will be between 1 and 6.
__current__ This returns 'current' if the nav item is the current page of if one of the children is current. This is already set as the class of the nav item <li> when applicable. 
__navid__ The ID of the nav record.
__parentnavid__ The ID of the parent nav record. Empty if no parent.

Parameters

id

The default id for the UL is "nav". Each child LI gets an ID based on this. An LI pointing to /information/ would have the id "nav_information". A second level LI pointing to /information/service-times/ would have the id "nav_infromation_service-times". Using the ID parameter will change the top UL id and the prefix of the children LIs.

Example:

"id:subnav",

open

This will remove the final </ul> from the output. This can be used to append additional LIs after the system generated content.

Example:

"open:yes",

js

Adds a onmousemover to each LI. Calls the function doSomething and passes the id of the LI as the value.

Example:

"js:yes",

class

Adds a class to the parent UL.

Example:

"class:navClass",find

Limits the returned nav to the current section of the nav based on which page the user is viewing.

Example:

"find:".$_GET['nav'],

You can also output the navigation branch of a particular page, using the page ID:

"find:p-######",

Lastly, you can output the branch of a particular navigation item (which may or may not have a page assigned), using the slug of that nav item's title:

"find:nav-title-slug",

bottomlevel

Limits the returned nav to X levels of nested output. bottomlevel:1 would only return the top level nav items.

Example:

"bottomlevel:1",

toplevel

Limits the returned nav to only items below the set level. "toplevel:2" would only show nav items from the second level down. Requires "find".

Example:

"toplevel:2",

newwindow

For each nav item set to open in a new window, the specified HTML is added to the <a> tag. By default, if this parameter is left out, target="blank" is used; otherwise, anything from rel="external" to some class name — whatever it is you use to open a link in a new window — can be used. Note: This parameter is only applicable when show tags are not used. See __ifnewwindow__ for use with show tags.

Example:

"newwindow:rel="external"",

Display mode: sitemap

Sitemap displays a nested UL with not only all nav items but also pages assigned to those nav items as well.

Parameters

levels

Sets how many levels of nav to return. "level:2" would only display two levels of nav.

Example:

"levels:3",

id

The default id for the UL is "sitemap". Each child LI gets an ID based on this. An LI pointing to /information/ would have the id "nav_information". A second level LI pointing to /information/service-times/ would have the id "nav_infromation_service-times". Using the ID parameter will change the top UL id and the prefix of the children LIs.

Example:

"id:sitemap2",

newwindow

For each nav item set to open in a new window, the specified HTML is added to the <a> tag. By default, if this parameter is left out, target="blank" is used; otherwise, anything from rel="external" to some class name — whatever it is you use to open a link in a new window — can be used. 

Example:

"newwindow:rel="external"",

Display mode: breadcrumbs

Displays a list of links to parent pages.

Parameters

find

Required, lets the API know which parent page to use.

Example:

"find:".$_GET['nav'],

delimiter

Changes the character that separates the links. Default is comma.

Example:

"delimiter: > ",

currentpage

Sets whether the current page will be shown in the list. Default is no.

Example:

"currentpage:yes",

newwindow

For each nav item set to open in a new window, the specified HTML is added to the <a> tag. By default, if this parameter is left out, target="blank" is used; otherwise, anything from rel="external" to some class name — whatever it is you use to open a link in a new window — can be used.

Example:

"newwindow:rel="external"",