- ๐บ๐ธUnited States fallenturtle
Sorry to necro-post, but I'm also having a similar issue as the OP. The ticket that this is marked as a duplicate seems to be about fields, not layout.
THEME HOOK: 'layout__onecol' FILE NAME SUGGESTIONS: x layout--onecol.html.twig * layout-onecol--node--2126.html.twig * layout-onecol--node-activity-inline-entity-form-view.html.twig * layout-onecol--node-activity.html.twig * layout-onecol--node-inline-entity-form-view.html.twig * layout-onecol--node.html.twig x layout--onecol.html.twig * layout.html.twig
I don't see the duplicate when I dump the variables (in my .theme file via HOOK_theme_suggestions_layout_alter:
^ array:6 [ 0 => "layout__onecol" 1 => "layout_onecol__node" 2 => "layout_onecol__node_inline_entity_form_view" 3 => "layout_onecol__node_activity" 4 => "layout_onecol__node_activity_inline_entity_form_view" 5 => "layout_onecol__node__2126" ]
I want to use layout-onecol--node-inline-entity-form-view.html.twig but I can't because something is putting layout__onecol.html.twig back at the top of the list and its happening after the theme suggestions function so I can't override it from that end either.
Using D9.5.9.
Edit: Worked around it by switching to a DS layout where the issue didn't exist.
I still see the duplicate, but its at least at the bottom so I can override it:
THEME HOOK: 'ds_1col' FILE NAME SUGGESTIONS: * ds-1col--node--2126.html.twig x ds-1col--node-activity-inline-entity-form-view.html.twig * ds-1col--node-activity.html.twig * ds-1col--node-inline-entity-form-view.html.twig * ds-1col--node.html.twig * ds-1col.html.twig * ds-1col.html.twig
^ array:6 [โผ 0 => "ds_1col" 1 => "ds_1col__node" 2 => "ds_1col__node_inline_entity_form_view" 3 => "ds_1col__node_activity" 4 => "ds_1col__node_activity_inline_entity_form_view" 5 => "ds_1col__node__2126" ]
- Status changed to Active
about 1 year ago 9:57pm 12 October 2023 - ๐ฆ๐บAustralia darvanen Sydney, Australia
#14: @fallenturtle I don't think that's a necro-post, you raise a valid point.
Anyone coming across this: a failing test would be a very good starting point to getting this fixed.
- ๐จ๐ฆCanada jmunger
Drupal 10.2.6, not using Display Suite.
I have a similar issue with menus. I want to use the menu--main--sidebar-first.html.twig but it seems impossible beacause of the menu--main.html.twig duplicate at the top of the suggestions.
<!-- THEME DEBUG --> <!-- THEME HOOK: 'menu__main' --> <!-- FILE NAME SUGGESTIONS: x menu--main.html.twig * menu--main--sidebar-first.html.twig x menu--main.html.twig * menu.html.twig -->