How does one work with themes?

I’ve read a lot in the documentation, but I really don’t get how certain things from a theme are supposed to be referenced, when you write a text in markdown, where exactly it goes. I’ve been trying to figure out exactly what I should be doing so I can properly use a different theme and write my content in the right place, but it just seems rather complicated.


The content of your markdown file will go in the block :

{% block content %},{% endblock %}
Of the corresponding `twig` file.

I'll give you an example of my own, 
I have a modular page `modular.html.twig`

{% extends ‘partials/base.html.twig’ %}
{% block content %}
{{ page.content }}
{% for module in page.collection() %}
{{ module.content }}
{% endfor %}
{% endblock %}

As you can see, the contant of a page `` will go in the `{% block content %},{% endblock %}`

My `` looks like that :

title: 'Page modulaire’
menu: 'Contenu’
onpage_menu: true
items: '@self.modular
by: default
dir: asc
- _texte
- _texte2

It will call two sub-modular in subfolder `_texte` and `_texte2`
In those subfolder I have a markdown file ``


  • titre: h1 de l’article
    titre2: h2 de l’article
    position: droite
  • image: section-01.jpg
    legende: Balise alt de l’image

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel cupiditate, laudantium ipsum nesciunt! Enim exercitationem epellendus accusantium minus obcaecati nisi, consectetur temporibus modi et aliquam. Dicta sunt beatae, illum sit!

The corresponding twig file texte.html.twig looks like that :

<section class="row contenu">
	{% for art in page.header.article %}
		{% if art.position|lower|contains('droite') or art.position|lower|contains('right') %}
			<article class="col-xs-12 col-sm-6 right">
		{% else %}
			<article class="col-xs-12 col-sm-6">
		{% endif %}
				<h1 class="titre1">{{ art.titre }}</h1>
				{% if art.titre2 %}
					<h2 class="titre2 color2">{{ art.titre2 }}</h2>
				{% endif %}
				{{ page.content }}
		{% endfor %}
		{% for img in %}
			<figure class="col-xs-12 col-sm-6">
				<img src="{{[img.image].url}}" alt="{{ img.legende }}" />
	{% endfor %}

In this template you can see {{ page.content }}, this is where the content of the will go.

I’m not a specialist in templating, but I hope that it will help :wink: