-
Notifications
You must be signed in to change notification settings - Fork 241
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
Menu doesn't appear in template #43
Comments
I've come across this before, I don't directly remember what caused this or what fixed it. I'll look into it. :) |
Nicolas you are an absolute legend |
I'm attempting this in multiple languages if that has an influence upon the bug? |
tips : the doc should say that we need to add a menu called main to start ... but that's another story Did you add page on this menu (link) ? |
Deleted my main menu and created a new one called test added test page to this menu and updated navigation blade reference to test all working ;) |
Hmmm is there an active class for the current page? |
You'd have to see with https://github.com/pingpong-labs/menus about the active classes. I already suggested this feature, if you'll +1 on it, maybe it'll get done faster.. :) |
Nice one, will have a look see |
I fairly certain this is related. I found that when:
The first item in the menu builder stays empty (no name, no options). There is no record created in menu__menuitem_translations. When the default is english it does get created. When the said item is not found in the db, the frontend Menu::get() function returns a presenter with an empty menu. Workaround I use for now:
Al is functional when adding items (as far as I know) |
This is because the first item is called 'root', not sure this is related. |
If your main language is not english (in our case dutch) the menu breaks. Even if you call it root. |
Yes, it's absolutely not the best implementation. Currently thinking of a better way of handling this root item creation, instead of hardcoding English, using the active languages. Shouldn't be too hard to implement, I'm curious to see if this will fix this issue. |
I've pushed this change in the 1.7 tag, please update and let me know if this fixes this issue. Thank you, |
The Menu::get and Menu::all both return null in the 1.7 for me. They return empty in english now too |
Hm, strange, if you look into the database, in the menu items table, you should see the root item translated for all active languages. Strangely enough, I can still get the main menu locally. Make you your menu is set to online as wel as the menu items. |
In the database it seems alright. Im requesting by the entered name, just no data. |
Are you sure you menu is online in all the languages , as well as the menu items ? |
Ah, excuse. it was indeed not online. Now its not null, but it has no data in it (there is in the menu in that language, but no html output except the bootstrap nav div). Switching back to english: "root" or any other name you called the menu is empty. With that obviously no db entry for that language, which is why it's empty. |
Alright so sounds like it's working like intended. |
well, the menu div shows, not the menu items. |
Again, you menu items need to be online. |
Ah, not only the menu, but the individual items too. Check. |
Awesome! 😄 |
The solution, the first time I encountered this, (my menus's weren't showing up either),.. was to ensure the menu was called "main" rather than what I had chose "menu1" (yes, I appropriately edited the navigation.blade to say menu1). Then, after clearing my caches, the menus showed up. A few months later, that solution didn't work for me. But by deleting the menu, and starting over using "test". It worked. So then I recreated a menu with "menu1" which now worked. How odd. Can anyone point me to current online examples of using Pingpong-las/Menus??.. Sadly, all the links I find for online documentation lead to 404's. :( For example,.. How can I modify the menus so they pop on flyovers,.. How can I style the results with CSS/Less,.. How can I do sub-sub menus which currently break the current default solution in AsgardCMS(v2) on Laravel5.3. ? The current videos on YouTube of AsgardCMS are all over a year old and don't address these subjects (yet?). Thanks for reading. |
Just for anyone still having issues with this, I had the same problem and although I had ticked the checkbox for the menu to be online, there is also a checkbox for each menu item to be online, which I had not ticked. Ticking all of the menu items as online as well as the menu itself solved the problem. |
Followed instructions here:
https://asgardcms.com/en/docs/menu-module/managing-menus
Menu is referenced in
views/partials/navigation.blade.php
as the default{!! Menu::get('main') !!}
and menu added as per below:...however menu fails to appear in front end.
The text was updated successfully, but these errors were encountered: