Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

"Bad Gateway" when including a page for a sidebar

Started by Muut Archive 10 years ago · 2 replies · 427 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 2597 9 years ago
Archive · by Muut Archive, 9 years ago
2 1706 9 years ago
Archive · by Muut Archive, 9 years ago
2 4999 9 years ago
Archive · by Muut Archive, 9 years ago
1 3830 9 years ago
Archive · by Muut Archive, 9 years ago
3 1814 9 years ago