Include a rendered page via pages.find

Hi,

in a twig template i want to include a special page:

{{ pages.find(’/sidebar’).content }}

But “content” only returns the raw content of that md file. How can I get the rendered content with it’s related twig template?

Using the above method grav doesn’t even complain when there is no sidebar.html.twig present.

One option is you can include a twig template for that sidebar and pass in the content to it.

{% include 'partials/sidebar.html.twig' with { content: pages.find('/sidebar').content() } %}
---

Hello rhukster,
i’m trying to use your way of implementing the content. But he just renders the content. Grav is not considering the media I added to the page.

Regards,

Michael

Media must be explicitly included in the page markdown. Are you doing so?

like how ;)?

How to include images is well documented. Please read the sections on Image Linking and Media at learn.getgrav.org.