
Today, we’re releasing a new premium account feature: the Navigation Manager. Here’s how it works in one sentence: you tell PageLime where your navigation file is, you put the css class “cms-navigation” on the element that contains your navigation, and PageLime publishes your updated navigation code into the file. Keep reading for an in-depth tutorial.
Managing navigation with PageLime has always been a super simple task: put some “cms-editable” tags on links, make the navigation file a server side include, and publish away. For most sites this works great. But what about sites with deep hierarchical menus? Well, it still works but now you’ve got a lot of bubbles on the screen. We’ve published some thoughts on this before in this post, and this is one of the reasons we’ve developed the Navigation Manager.
The Navigation Manager is a bit more involved than simply putting a CSS class on a DIV tag. First, you must use an include file for your navigation, so that it is shared across your entire site. In the future, we will probably do away with this requirement, but for the time being, it’s the simplest way to ensure it gets updated on all of your pages.
Once your navigation file set-up in an include, you must wrap your navigation HTML code in an element that has the CSS class “cms-navigation”. This is how PageLime knows where to publish updated navigation code. For example:
<div id="top_nav" class="cms-navigation"> <!-- navigation will come here --> </div>
OK, with the above two steps complete, you now have to enable the “Navigation Manager” feature on the site features screen.

Once the feature is active, you will see a new site dashboard item: “Manage Navigation.” When you open it up for the first time, you will be prompted to configure your navigation settings. Here’s what you’re going to need to do:
- Tell PageLime where your navigation file is. (for example: /includes/header.php)
- Enter your navigation code into PageLime, so we know what format to use when publishing.

Step 2. might look a bit intimidating, but it’s actually super simple. In the code editor box, you can enter some pseudo-code that tells PageLime how to render your navigation. There should already be some sample code that you can use in there. When you hit publish, PageLime will take this code, and merge the navigation data into it, and then publish it into the DIV tagged “cms-navigation” in your navigation file.
The pseudo-code is based on the popular Apache Velocity template engine. You can read their user guide for an in-depth overview of everything you can do, but you really don’t need to do that. Take a look at the code below to learn some basics:
#foreach( $navItem in $navItems )
<div>
<a href="$navItem.URL" class="nav-link">$navItem.Title</a>
#if ($navItem.ChildNodes.Count > 0)
<div class="sub-nav">
#foreach( $subNavItem in $navItem.ChildNodes )
<div><a href="$subNavItem.URL" class="subnav-link">$subNavItem.Tile</a></div>
#end
</div>
#end
</div>
#end
The areas highlighted in bold are the pseudo code that renders the navigation data into the HTML. So let’s step through what’s going on:
- The first line basically says “for each navigation item in the group of root navigation items, render the following”
- Then, we have some HTML code, which has some special tokens that will get replaced, such as $navItem.URL and $navItem.Title
- Then we loop through all of the sub navigation items for the current $navItem and render the subnav.
OK, now you can save your settings and you’ll be taken back to the navigation manager. You can now start building out your navigation, and save your progress. Once you or your client are ready to push the changes out to your site, hit the publish button and you’re done!

Here are some additional things you can do:
- On the “navigation settings” screen you can lock the root nodes of the navigation, so that the primary navigation can only be edited by the administrator. For example, if you don’t want your clients to change anything but the sub-navigation, you can lock them on the settings screen. (Additionally, any sub-navigation node can individually be locked by editing it and checking the “lock this node”).
- You can re-order the nodes by dragging them by the globe icon and dropping them in the desired space.
Hope that was informative! As always, post questions and thoughts in the comments below or in the forum.
Tags: navigation












Freakin awesome! =D
pretty cool guys
How would it work with only html?? quite confused:S
please help!!!
Hi Chris - not sure I understand the question. Can you describe what you’re trying to do?
Excellent implementation guys, very easy to use.
I think that what Chris is saying is that most drop-down navigation menus use Javascript and/or CSS for the implementation (mine uses an external Javascript file)…but in this post I don’t see anything referring to these files, just HTML/PHP stuff.
Hi Scott,
The navigation code gets publish into your page into the div with the class “cms-navigation”
You can include JS, CSS, and anything else in your HEAD tag for the page just fine. You don’t need to put it into the code window on the navigation settings at all.
The concept here is that you have a server side include navigation file, where you tell PageLime to publish your nav code.
you guys are @#$$ing champs.
I’ve got to say. I’m more impressed and glad to be a customer every month. Whether my customers ever find out about any of these features, I don’t know. But this stuff is getting better every time I check the blog. Keep it up Pagelime!
Hi,
I use Dreamweaver to put my websites together and tend to create a navigation menu on an initial page and then turn it into a “Library item” so I can drop it onto further pages where it will auto update if I edit it at a later date - pretty much like a server include I guess just running locally. This library item is tucked away in a “Library” directory which is uploaded to clients web space along with all of the other web files.
Is Pagelime able to recognise these “library” items as includes and then alter the navigation through the “nav manager” accordingly?
Cheers
G
Hi Gary,
As long the nav item is an include you should be able to edit it via the includes feature or via the nav manager. If you’re still having trouble shoot an email over to support and we’ll help you figure it out.