Skip to content
Grav 2.0 is officially stable. Read the announcement →
Content & Markdown

How to add nested twig attributes?

Started by M 4 years ago · 0 replies · 845 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, 9 months ago
6 518 9 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 497 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 427 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 350 1 year ago
Content & Markdown · by belthasar, 2 years ago
4 649 2 years ago