Hello guys,
Recently i'm working with Drupal 8 to develop my page.
But I struggle on how to get logo variable in menu--main.html.twig.

I have put {{ logo }} in menu--main.html.twig but it is not working.
while {{ logo }} working in page.html.twig

Comments

Jeff Burnz’s picture

You'd have to add it in something like a preprocess function, {{ logo }} is not available in menu templates by default.

I think a better question is - why are you doing this and why not just use the branding block, or hard code it?

vindesh’s picture

Jeff according to my menu design i need to place logo between menu,
please check screenshot- http://awesomescreenshot.com/08967fah8b

I want to put logo between menu, i have try to add the logo variable in theme_preprocess_page function but {{ logo }} it is not working, do you have any solution?

Jeff Burnz’s picture

What I would do is make a link in the menu to "Home" and use text image replacement for the logo image, rather than trying to jam it in there with a variable.

vindesh’s picture

Thanks Jeff