Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

How to add nested twig attributes?

Started by M 4 years ago · 0 replies · 1088 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, 1 year ago
6 1427 1 year ago
Content & Markdown · by Ton Haarmans, 2 years ago
10 1100 2 years ago
Content & Markdown · by Jan L'Am, 2 years ago
4 966 2 years ago
Content & Markdown · by Leonardo, 2 years ago
3 883 2 years ago
Content & Markdown · by belthasar, 2 years ago
4 1341 2 years ago