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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

How to add nested twig attributes?

Started by M 4 years ago · 0 replies · 740 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, 8 months ago
6 97 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 185 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 147 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 61 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 255 1 year ago