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

"Bad Gateway" when including a page for a sidebar

Started by Muut Archive 10 years ago · 2 replies · 358 views
10 years ago

I've got a page informations that I'm trying to include as a sidebar on every page from base.html.twig using the code

TWIG
<aside>
    {% include 'modular.html.twig' with {'page': page.find('informations')} %}
</aside>

Unfortunately this code results in the infamous PHP-FPM "Bad Gateway" error under Nginix. Is there a better way to include a page from a template?

10 years ago

You probably need to just do page.find('/informations')

10 years ago

Thanks Flavio. I also missed the for loop, but now it works:

TWIG

{% for page in page.find('/informations').children %}
     {{ page.content }}
 {% endfor %}
---

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1361 9 years ago
Archive · by Muut Archive, 9 years ago
2 939 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2958 9 years ago
Archive · by Muut Archive, 9 years ago
3 1123 9 years ago