Muut
August 4, 2016, 2:52pm
1
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.
Muut
August 4, 2016, 3:32pm
2
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() } %}
---
Muut
October 3, 2016, 10:53am
3
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
Muut
October 3, 2016, 12:06pm
4
Media must be explicitly included in the page markdown. Are you doing so?
Muut
October 3, 2016, 5:09pm
6
How to include images is well documented. Please read the sections on Image Linking and Media at learn.getgrav.org.