-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IsMenuCurrent() returns false if menu item defined inside config file #3459
Comments
No, but as it depends on the |
I just uploaded a working site where menus do not work: https://github.com/lebarde/apo As you can see here, the home button is active on the homepage. But on the biographie/ page the Note that this is the case if I create the menu in the pages' front matters. |
One nice resolution would be the ability to define menu items by their identifiers or their routes (I assume that identifiers is easier to implement). In that way you do
In this case, Hugo would look for a page which identifier is named IMO the page file has to define its identifier (or it is defined automatically from filename or main title, I don't know the current policy on that), and then you define the menu globally. This is for me a good way to have an overview of the whole menu. |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
Hi all! I keep experiencing the same problem. Don’t know whether it is in issue or a problem of understanding.
Attached you find an example. “Home“ and “blog” are provided with a Thanks! |
I am seeing the same issue. While my code isn't the exact same as @Brixy - I have a similar setup. Menu is defined in the config file - renders out just fine but IsMenuCurrent fails to work. |
Yes, I have the same issue as @cfjedimaster too. Anyone has any idea to fix it? |
I'm facing the same issue with |
Solved this for myself just now by adding trailing slashes to my menu items in the config! I didn't realize it was matching by URL, but using |
Hi @kalilsn The config file in the zip file linked above uses trailing slashed for Have you success when you run hugo with that test folder? |
When defining multilingual menus the IsMenuCurrent function does not work as expected. Expected result: Both menus get the "active" class when navigating to the respective page. Temporary fix: set the "ja" menus URL to config.toml:
menu partial:
|
Please don't comment on old, closed issues. Use the discussion forums or open a new issue. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
It appears that
IsMenuCurrent
orHasMenuCurrent
do not return true everytime it should.But it seems not to work on menu items defined inside the main configuration file.
Is this a confirmed bug? At least this is the case for me.
Reference of discussions this is based upon:
false
for current menu #2556The text was updated successfully, but these errors were encountered: