How do I add an HTML block from template extension to main layout template? (i.e. meta data) I have a main layout file and extending it with another template. I have my markup and content in the {% block content %}{% endblock %} however, I'd like to add content to another "block" on the individual entry page for meta data - that would require adding another {% block content %} to my template as it would need to be output in a different area of the layout template.

Essentially, is there a way to add a second block (perhaps name it differently) or is my best bet to set all that meta data as a variable and pass it that way?
Option A: Set individual properties in the child template

If you want to set specific meta properties instead of defining a block, you can include lines like this in _layout.html:

{% if metaDescription is defined %}&lt;meta property="description" content="{{ metaDescription }}"&gt;{% endif %}
{% if metaKeywords is defined %}&lt;meta property="keywords" content="{{ metaKeywords }}"&gt;{% endif %}


Then, you can simply set either value from within the child template...

{% set metaDescription = entry.summaryFieldOrWhatever %}
{% set metaKeywords = entry.tagField %}


Option B: Pack an array with properties in the child template

...or as you pointed out, that could get cumbersome if you have a whole bunch of meta data. In that case, you could take a similar approach with an object instead of a block. So in _layout.html:

{% if metaProperties is defined %}
     {% for prop in metaProperties %}
     &lt;meta property="{{ prop.name }}" content="{{ prop.value }}"&gt;
     {% endfor %}
{% endif %}


In the child template, then, you could...

{% set metaProperties = [
    { name: "description", value: entry.summaryFieldorWhatever },
    { name: "keywords", value: entry.tagField }
] %}


This way, you could set as many items as you'd like and still avoid passing markup to the parent template.

[EDIT] Typo fix