fabpot/Twig — Issue #523: included templates doesn't have access to defined blocks
Author: Zakay
Created: 2011-11-20 13:34:43+00:00
State: open

If I include a twig file that uses blocks defined from an extended template the include will define new blocks instead of outputting data into the defined blocks from the extended template.

general_layout.twig
```jinja

{% block head %}{% endblock %}

{% block page_title %}{% endblock %}
```

layout_simple.twig
```jinja
{% extends "general_layout.twig" %}

{% block head %}
<link rel="stylesheet" type="text/css" href="/all.css" />
{% include 'meta.twig' %}
{% endblock %}
```

meta.twig
```jinja
{% block page_title %}Test{% endblock %}
```

This will output
```html
<head>
<link rel="stylesheet" type="text/css" href="/all.css" />
Test
```

Instead of
```html
<head>
<link rel="stylesheet" type="text/css" href="/all.css" />
<title>Test

```