Skip to content
● Critical PHP security fixes are out: update PHP on your Grav sites. What to do →

How to add nested twig attributes?

Started by M 4 years ago · 0 replies · 1051 views
4 years ago

I want to integrate the guestbook plugin into future2021 theme and render the existing guestbook entries as blog-items. blog_item.html.twig accesses the attribute page.header.continue_link. I'd like to make use of that attribute, but the guestbook entry doesn't contain it, of course.

I know that I can set simple attributes using {% set child = child|merge({'title': child.author}) %} and pass child as page to blog_item.html.twig. But how can I set nested child.header.continue_link to false when there's no header attribute in child?

last edited 12/10/22 by M

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 12 months ago
6 1284 12 months ago
Content & Markdown · by Ton Haarmans, 2 years ago
10 1015 1 year ago
Content & Markdown · by Jan L'Am, 2 years ago
4 889 2 years ago
Content & Markdown · by Leonardo, 2 years ago
3 814 2 years ago
Content & Markdown · by belthasar, 2 years ago
4 1232 2 years ago