Timeline for Why do I get Template "@bartik/block" is not defined?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 15, 2019 at 16:39 | comment | added | leymannx | @frmt – Thank you! What I suggested, it goes up then until the final parent. I subscribed to mentioned issue on GitHub. As well still have no answer to why that happens. | |
Oct 15, 2019 at 16:12 | comment | added | frmt |
Here is an update @leymannx. @block/block.html.twig works too, although the resulting output is minimal, I'm assuming Classy is pretty bare bones. When using your original suggestion I get a lot of stuff inherited from Bartik.
|
|
Oct 15, 2019 at 0:08 | comment | added | frmt | Will do. Once I get back in the office in the morning I'll try that out and update you. There is a similar issue I'm having related to the same webinar on GraphQL Twig, so I also commented on that issue. It hasn't been addressed in three months so hopefully pinging it again will bring it to the forefront again. | |
Oct 14, 2019 at 21:29 | history | edited | leymannx | CC BY-SA 4.0 |
Added namespace example
|
Oct 14, 2019 at 21:17 | history | edited | leymannx | CC BY-SA 4.0 |
Mentioned Twig namespaces
|
Oct 14, 2019 at 21:05 | comment | added | leymannx |
@frmt – Can you tell me what happens when you put {% extends "@block/block.html.twig" %} . I wonder if it takes Bartik's or Classy's block then or if it still errors out as Classy (which Bartik is a sub-theme of) has no templates/block.html.twig but only a templates/block/block.html.twig.
|
|
Oct 14, 2019 at 21:03 | comment | added | frmt | It's even in the documentation in places like GraphQL Twig. I posted in their Slack channel about it, hopefully I can gain some more insight as to what they are doing. | |
Oct 14, 2019 at 20:51 | comment | added | leymannx | @frmt – Oh wow, I've never recognized Twig namespacing is actually used in a few places even in core. I just tried the same but for me it also doesn't work. Whereas Drupal root-relative paths work just fine... | |
Oct 14, 2019 at 20:36 | vote | accept | frmt | ||
Oct 14, 2019 at 20:35 | comment | added | frmt |
Thanks @leymannx that has appeared to do the trick. In my searches to find a solution I found similar suggestions but the particular example I was looking at on YouTube showed him successfully using {% extends @bartik/block" %} . Could that perhaps be that the tutorial was from mid-2018 and that's no longer how it's done?
|
|
Oct 14, 2019 at 20:29 | history | answered | leymannx | CC BY-SA 4.0 |