I am using Flask micro-framework for my server which uses Jinja templates.
I have a parent template.html
and some children templates called child1.
You can use the include statement.
Use the jinja2 {% include %} directive.
{% extends 'template.html' %}
{% block content %}
{% if task == 'content1' %}
{% include 'content1.html' %}
{% endif %}
{% if task == 'content2' %}
{% include 'content2.html' %}
{% endif %}
{% endblock %}
This will include the content from the correct content-file.