Closed (fixed)
Project:
Sitemap
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jun 2020 at 19:35 UTC
Updated:
2 Nov 2020 at 15:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
akalata commentedUnfortunately, until #2511548: Add a "context" array variable to all theme hooks and "#context" array property to all elements to provide optional contextual data lands (which would allow us to include a
#contextelement when declaring#theme => menu), I think we're stuck with the initial approach.This patch re-adds the menu-specific
menu__[menu_name]suggestion, and adds asitemap__menu__[menu_name]suggestion.Comment #3
digitaldonkey commentedPatch works as expected. Allows overriding the template again.
Comment #4
pauleb commentedThanks for the patch!
I can confirm that the result of the patch from comment #2 is as expected.
But I'm not sure if the template suggestions when enabling twig debug are correct.
After applying the patch and clearing the caches the new template is used, but the file name suggestion looks like:
I'm not deep into theming, but as I understand it the "x" marks the used template and menu--sitemap.html.twig should not appear two times with different specificity in the suggestions.
It still works for me, but I am not sure if this is a problem for someone else.
I'm using Drupal 8.9.6 and a bootstrap_barrio - bootstrap_sass - subtheme.
Edit: While this behaviour appears on the main menu, it does not on a custom menu I created.
Comment #6
akalata commented@pauleb I'm pretty sure that is an active core issue: #2881195: Duplicate template suggestions.