Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By vindesh on
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
You'd have to add it in
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?
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Jeff according to my menu
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?
What I would do is make a
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.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Thanks Jeff
Thanks Jeff