Timeline for Template for specific content type
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 15, 2021 at 13:30 | comment | added | uneeb meer | Hi, I'm kinda stuck at the same issue my twig template is not rendering for my custom content my module name is cspace and path is cspace/templates/node--cspace.html.twig and the twig file only contains a heading at the moment, can you please point out what maybe the issue in my case? | |
Mar 29, 2017 at 15:11 | comment | added | Kevin | You can't do that out of the box. You'd either have to use block reference fields on the node, or use a preprocess function to load the blocks, render them, and inject them into the variables array for the node twig template. Region printing is not done at the node level. | |
Mar 29, 2017 at 15:09 | comment | added | Tourist | I really don't get the logic behing it :( I'm using Views to create blocks for each field. In /structure/block, I place blocks (created with Views) in the regions I want. How do I print the regions with my node--recette.html.twig ? | |
Mar 29, 2017 at 14:40 | comment | added | Kevin |
Note: {{ content.field_name }} refers to fields on the node type.
|
|
Mar 29, 2017 at 14:35 | history | edited | Kevin | CC BY-SA 3.0 |
added 56 characters in body
|
Mar 29, 2017 at 14:34 | comment | added | Kevin |
Node template variables can be output with {{ content.field_name }} - content is the render array. page. would do nothing in the context of a node twig template.
|
|
Mar 29, 2017 at 14:33 | comment | added | Kevin |
No, the node level template only handles the content of a node. page level template controls output of of regions/markup in the theme.
|
|
Mar 29, 2017 at 14:32 | comment | added | Tourist | Do I need to rewrite all the page in this file ? pastebin.com/XaXKn4sr here is the content of my node--recette.html.twig and it doesn't print anything ;( Sorry, i'm really novice with twig. | |
Mar 29, 2017 at 14:30 | history | answered | Kevin | CC BY-SA 3.0 |