Menu icon Foundation
Zurb Handlebars Navigation Patter

Is there a way to achieve an active class on navigation items, in Foundation for Sites templates, like you can with Foundation for Apps using ui-sref-active?

Resource: http://foundation.zurb.com/apps/docs/#!/angular

classesnavigationtemplatingsites

Is there a way to achieve an active class on navigation items, in Foundation for Sites templates, like you can with Foundation for Apps using ui-sref-active?

Resource: http://foundation.zurb.com/apps/docs/#!/angular

Geoff Kimball over 3 years ago

We defer active state management for navigation, pagination, etc. to the backend. ui-router's ui-sref-active exists because Angular is designed for single-page apps, which manage state on the client side.

If you hook your Foundation site into a backend framework like Rails, you can use that to manage active state. If you're building a static site, you might have access to a templating engine like Handlebars, which would allow you to do something similar.