craft-menus icon indicating copy to clipboard operation
craft-menus copied to clipboard

__home__, /, and active class

Open pixeljitsu opened this issue 10 years ago • 4 comments

If I create a menu linked to the homepage single the generated URL is:

example.com/__home__

and the menu is highlighted as active, then if visiting

example.com/ 

the menu is no longer active and I have the same content in both URLs

If instead I create a custom URL using just / then the menu is always active because it sees all pages a children.

Is there a way around this?

What I would like to be able to do is just link to the homepage single and omit the

 __home__ 

from the generated URL.

Thanks.

pixeljitsu avatar Mar 04 '15 07:03 pixeljitsu

I would also like to see a solution to this problem!

herrfarsi avatar Mar 18 '15 10:03 herrfarsi

This is something I have been having issue with too.

CountKyle avatar May 12 '15 13:05 CountKyle

Simple work around for now is to add something like this above your menu template.

{% set homeIsCurrent = (entry.section.handle == 'homepage') %} <li role="presentation" class="{% if homeIsCurrent %}active{% endif %}"> <a href="{{ siteUrl }}">Home</a> </li>

fyrebase avatar Aug 15 '15 04:08 fyrebase

Hey everyone sorry for the radio silence, hoping to address this in the update im planning this week

keithmancuso avatar Feb 17 '16 18:02 keithmancuso