Active Class for Menus #11
joeworkman
started this conversation in
General
Replies: 1 comment
-
A somewhat more general situation is where you have a topbar with several drop down menus. Each dropdown menu has a title that we would like to highlight as well as the selected menu item, i.e., we would like something like
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a continuation of a discussion over at https://github.com/foundation/foundation-sites/discussions/12351#discussioncomment-1930388
@benthien had a question on how to add an active class to his menu items. It's a good question. Here is an example of how you could accomplish this. I think that this could be made better in time.
General Overview:
output
variable in the front matter of every page. This will specifically define the path to the page when it's builtis_active
macro that we can use to determine if a page is active or not.pages/one.html
macros/nav.twig
partials/nav.html
Beta Was this translation helpful? Give feedback.
All reactions