<p>Yes, see the block tags docs. <a href="http://twig.sensiolabs.org/doc/tags/extends.html#block-nesting-and-scope" rel="nofollow">http://twig.sensiolabs.org/doc/tags/extends.html#block-nesting-and-scope</a></p>

CC BY-SA 3.0
2016-03-05T19:16:26.667Z
2016-03-05T19:16:26.667Z
carlcs
<p>I lazily added the following to my parent site template:</p>

<pre><code>{% block body %}
    {% block content %}
    {% endblock %}
{% endblock %}
</code></pre>

<p>Is this 'allowed' in Twig ?</p>

CC BY-SA 4.0
2019-05-01T16:53:13.183Z
Question title asks if it's a problem, body asks if it's allowed. Accepted answer says "Yes, see here". Will someone either edit the title to reflect permissibility, or the body and answer to reflect, err... problematicability? And yes, I just invented that word.
Sandwich
<templating>
Nesting blocks - is the following problematic?
# Nesting blocks - is the following problematic?

(Asked by: username_0 on 2016-03-05)

I lazily added the following to my parent site template:
{% block body %}
    {% block content %}
    {% endblock %}
{% endblock %}

Is this 'allowed' in Twig ?

**Tags:** templating

> **Comments:**
> **username_1**: Question title asks if it's a problem, body asks if it's allowed. Accepted answer says "Yes, see here". Will someone either edit the title to reflect permissibility, or the body and answer to reflect, err... problematicability? And yes, I just invented that word.  

---

## 1 answers

### Answer by username_2 on 2016-03-05. Score: 3 | Accepted answer

Yes, see the block tags docs. <http://twig.sensiolabs.org/doc/tags/extends.html#block-nesting-and-scope>


---

