Demo: Dynamic CF Navigation Menu with 'current page' marker
ColdFusion Navigation Menu Demo
Sometimes you just need a simple menu.
If your list is very long, making a link with a class and an id, typing the href value for each, and inserting the link text all by hand can get old. And then - how do you show which link is the current page?
Here we set up a simple list of url/text pairs, and then loop through that list to create our links.
Then - much like the popular javascript-based 'current page' menus - we look at the value of the link url, and the current page url (cgi.SCRIPT_NAME) - if they are the same, we have a winner. One other thing I find myself commonly wanting is a bit of special css on the first or last item in a list, so the code also assigns IDs to those links.


There are no comments for this entry.
Add Comment