0

I'm leveraging the Superfish module for our menus but need to tweak the output a bit.
Normally I'd just copy the relevant template file (in this case superfish-menu-items.html.twig) into my theme and call it a day.
This isn't working in this case. Any ideas why that might be and how to get around it?

Before voting to close this issue, I'd ask that you request information you think would be valuable to providing additional specificity.
I can only assume that this issue is due to some issues with the construction of the Superfish module itself and its theming implementation, so I'm trying to figure out how to work around this.
Any solution would likely be applicable in similar contexts as well.

I've tried modifying the element in hook_theme() and hook_theme_registry_alter() to point to my theme's implementation of the template, but in both cases I end up hitting

Twig_Error_Loader: Template is not defined errors.

EDIT: I'd already enabled debugging prior to posting. Please stop suggesting that I enable debugging. This is what is shown before and after copying the template into my theme. I've cleared caches and verified the template name in my theme.enter image description here

6
  • Did you rebuild cache?
    – prkos
    Feb 10, 2019 at 22:03
  • Yes I rebuilt the cache and doublechecked the naming.
    – Mrweiner
    Feb 10, 2019 at 22:15
  • Do you have debug enabled? It will tell you what file is being used Debugging Twig templates
    – prkos
    Feb 10, 2019 at 22:23
  • 1
    Yes, I have debugging enabled and it shows the default implementation being used instead of the version in my theme.
    – Mrweiner
    Feb 10, 2019 at 22:27
  • 1
    i have tested it, it works just copy/past superfish-menu-items.html.twig to templates folder (Not root folder) of your theme, and flush caches it will work.
    – berramou
    Feb 10, 2019 at 23:53

1 Answer 1

-3

For drupal8 you need to enable twig debug in the service.yml file. Then clear cache. After that, you will see in the browser inspector all templates name suggestion to override a part of the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.