Skip to content
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

Closed
seanthepottingshed opened this issue Jun 9, 2015 · 25 comments
Closed

Menu doesn't appear in template #43

seanthepottingshed opened this issue Jun 9, 2015 · 25 comments

Comments

@seanthepottingshed
Copy link

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:

screen shot 2015-06-09 at 11 11 06

...however menu fails to appear in front end.

@nWidart
Copy link
Member

nWidart commented Jun 9, 2015

I've come across this before, I don't directly remember what caused this or what fixed it. I'll look into it. :)

@seanthepottingshed
Copy link
Author

Nicolas you are an absolute legend

@seanthepottingshed
Copy link
Author

I'm attempting this in multiple languages if that has an influence upon the bug?

@Grummfy
Copy link

Grummfy commented Jun 9, 2015

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) ?

@seanthepottingshed
Copy link
Author

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 ;)

@seanthepottingshed
Copy link
Author

Hmmm is there an active class for the current page?

@nWidart
Copy link
Member

nWidart commented Jun 9, 2015

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.. :)

pingpong-labs/menus#20

@seanthepottingshed
Copy link
Author

Nice one, will have a look see

@Thorazine
Copy link

I fairly certain this is related.

I found that when:

  • English is not the main language.
  • you create a new menu

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:

  • make the default english.
  • create your menus
  • switch back

Al is functional when adding items (as far as I know)

@nWidart
Copy link
Member

nWidart commented Aug 3, 2015

This is because the first item is called 'root', not sure this is related.

@Thorazine
Copy link

If your main language is not english (in our case dutch) the menu breaks. Even if you call it root.

@nWidart
Copy link
Member

nWidart commented Aug 3, 2015

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.

@nWidart
Copy link
Member

nWidart commented Aug 3, 2015

I've pushed this change in the 1.7 tag, please update and let me know if this fixes this issue.

Thank you,

@Thorazine
Copy link

The Menu::get and Menu::all both return null in the 1.7 for me. They return empty in english now too

@nWidart
Copy link
Member

nWidart commented Aug 5, 2015

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.

@Thorazine
Copy link

In the database it seems alright. Im requesting by the entered name, just no data.
Just switched to the 1.7 menu, but no change in result.

@nWidart
Copy link
Member

nWidart commented Aug 5, 2015

Are you sure you menu is online in all the languages , as well as the menu items ?

@Thorazine
Copy link

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.

@nWidart
Copy link
Member

nWidart commented Aug 5, 2015

Alright so sounds like it's working like intended.
If all the menu items (or just the ones you want to display), are online they will show up.

@Thorazine
Copy link

well, the menu div shows, not the menu items.
When requesting Menu::all(), the items array is empty.

@nWidart
Copy link
Member

nWidart commented Aug 5, 2015

Again, you menu items need to be online.

@Thorazine
Copy link

Ah, not only the menu, but the individual items too. Check.
Thanks!

@nWidart
Copy link
Member

nWidart commented Aug 5, 2015

Awesome! 😄

@nWidart nWidart closed this as completed Aug 5, 2015
@koppenhoefer
Copy link

koppenhoefer commented Jan 9, 2017

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?).
EDIT*03.2017: I have found this url to help: http://laravel5pingpong.blogspot.com/2016/08/laravel-5-menus.html

Thanks for reading.

@bchellingworth
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants