Hi all. Will start from the question. How to print out md header content correctly without hardcoding the path with /components/ folder. PS. We need to use the components folder, so that the site structure is clear to the client to edit.
We have the following site structure in admin panel:
Screen Shot 2016-07-04 at 13
In frontpage.md we define the content which will be printed out on the frontpage.html.twig
title: Home
published: true
content:
items:
- '@page.self': '/components/_certificates'
- '@page.self': '/components/_partners'
- '@page.self': '/components/_services'
the code of frontpage.html.twig
{% set collection_path = page.find(path).collection('content') %}
{% for module in collection_path %}
<div class="section">
<div class="row">
{% for module in collection_path %}
{% include '/modular/one_' ~ path|slice(13,path|length -14 ) ~ '.html.twig' %}
{{module.content}}
{% endfor %}
</div>
</div>
{% endfor %}
Path variable contains the name of folder(ex. /components/_certificates ).
The final target is to show all modules, which we have in frontpage.md header.