I understand that everything inside the pages folder is being rendered in the content block.
But I also have different types of content that I would like to render in another block.
For instance: I am using the foundation framework and generally all content is rendered within a div with a row class which defines the pages boundaries. But on my homepage I want to place an image slider which uses the full browser’s width.
Sounds like you might want to look at modular page types for your homepage. That way you can build a page with multiple markdown files for different areas of your homepage, each with their own twig file to render. Check out the One-Page Skeleton in the downloads for a good working example of how this is achieved.
Still having a problem to wrap my head around. I can’t get over it that there SEEMS to be only the {{ page.content }} variable where everything from the folder ‘pages’ goes. Am I right about that?
I managed to solve my original issue with a modular page but now I am facing a new one. In my footer, which is global, I want to place an additional section which should be fillable by markdown like all the other content in the ‘pages’ folder.
I don’t want to hardcode content in a twig template. Template and content should stay separate. So how can I render content for the footer that is NOT part of {{ page.content }}?
Yup, that’s perfectly legit! Might wan to use another variable so it doesn’t conflict with the content that is set in Twig vars, but other than that it’s good.
Thanks! That’s what i needed. I slightly changed the code to have the if statement test the “Page” instead of the content, makes more sense to me to do it this way.
{% set footerpage = pages.find('/footer') %}
{% if footerpage %}
{{ footerpage.content }}
{% endif %}
---