2

My site lives at something like http://example.com/subdomain/ee. Visiting that site root displays the home page just like I want it to. However, I'm using Structure to output a main navigation like so:

{exp:structure:nav css_class="nav-main" current_class="active" max_depth="1" }

This works great for the most part, except I have a Home link in the main navigation that is the home page, and it's only getting the "active" class if I'm //example.com/subdomain/ee/home, not if I'm at //example.com/subdomain/ee.

I'm relatively new to EE, so I suspect there may be a simple way to fix this. Is there a good way to still use structure to output the primary navigation and have it apply the active class to the "Home" link when on the site root? Is there a better way to approach this than what I'm doing?

1 Answer 1

5

To make this work, in the entry for Home under the structure tab, set the Structure Page URL to "/"

1
  • Argh, so easy! I'd tried changing the regular URL title (in the Publish tab) to "/", but when I submitted that it reverted back to "home". I could've sworn I tried changing the structure page URL as well, but clearly I didn't since this worked perfectly. Thank you!
    – John O
    Feb 17, 2015 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.