Quick Start

Quick Start

To get started with SimpleNav you need the following:

Create a nav.xml file

Use the example as a template

Add simpleNav init call to onRequestStart

Drop the following snippet into your Application.cfc onRequestStart and set the variables as appropriate.

<cfscript>
	basedir="/";
	navXMLLocation = '#expandPath(".")#/nav.xml';
	request.oNav = createObject('component','net.redbd.simpleNav.SimpleNav');
	request.oNav.init(navXML= navXMLLocation,
			baseDir = baseDir,
			location =  CGI.SCRIPT_NAME,
			cache="application",
			flushCache=reinit);
</cfscript>

Add a renderer to your header template

In your header template add the following:

<cfimport taglib="/net/redbd/simpleNav/navRender" prefix="nav">
<nav:singleMenuLevel menu="#request.oNav#" id="navPrimary">
<nav:singleMenuLevel menu="#request.oNav#" id="navSecondary" level="2">

This will give you a two level navigation structure.

All you need to do is style it up and you're done.