Timeline for How do you output views reference field views in Twig?
Current License: CC BY-SA 4.0
19 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Aug 7, 2018 at 16:01 | history | bounty ended | CommunityBot | ||
S Aug 7, 2018 at 16:01 | history | notice removed | CommunityBot | ||
Aug 7, 2018 at 2:02 | vote | accept | clestcruz | ||
Jul 30, 2018 at 21:52 | history | edited | leymannx | CC BY-SA 4.0 |
edited title
|
Jul 30, 2018 at 21:49 | answer | added | leymannx | timeline score: 6 | |
Jul 30, 2018 at 21:22 | history | edited | leymannx | CC BY-SA 4.0 |
added 72 characters in body
|
Jul 30, 2018 at 20:57 | history | edited | leymannx | CC BY-SA 4.0 |
added 136 characters in body
|
Jul 30, 2018 at 20:51 | history | edited | leymannx | CC BY-SA 4.0 |
added 136 characters in body
|
Jul 30, 2018 at 16:05 | history | edited | clestcruz | CC BY-SA 4.0 |
added 89 characters in body
|
Jul 30, 2018 at 15:35 | answer | added | 4uk4 | timeline score: 2 | |
S Jul 30, 2018 at 14:56 | history | bounty started | clestcruz | ||
S Jul 30, 2018 at 14:56 | history | notice added | clestcruz | Authoritative reference needed | |
Jul 30, 2018 at 10:51 | comment | added | clestcruz |
I've managed to render the view using view reference field module by printing {{ page.content }} but is there a way to explicitly to print and instead of using {{ page.content }}
|
|
Jul 27, 2018 at 11:06 | comment | added | Hudri |
You don't call them directly, you just create a file with a corresponding name in your theme folder and it gets called automatically by {{ content }} . I'd suggest to take a look at core theme stable and look for view-*.html.twig there to find out which variables are available in those files. Remember there a different view types, this tutorial has a good overview which view uses which file names.
|
|
Jul 27, 2018 at 8:41 | comment | added | clestcruz |
if I'm not mistaken, views template is somewhat like this views-view-list.html.twig How can I call the template within my page.html.twig ?
|
|
Jul 26, 2018 at 8:28 | comment | added | Hudri |
For the field label you can use {{ node.field_myfield.fieldDefinition.label }} . For nested field values from inside your view, you must use the proper view templates, you can't easily access them in page or node.
|
|
Jul 26, 2018 at 8:09 | comment | added | clestcruz |
I tried that on my page.html.twig node.field_view_works.title but it outputs a numerical value 1
|
|
Jul 26, 2018 at 5:44 | comment | added | Hudri |
Its just a field, so the views reference field can be rendered with {{ content.field_your_views_reference_field }} . If you want to change the output of the view, use the views template suggestions.
|
|
Jul 26, 2018 at 0:51 | history | asked | clestcruz | CC BY-SA 4.0 |