<p>I think your output is wrong. Looking at your code and explanation, <code>{% for row in entry.hgroup %}</code> should be: <code>{% for row in block.hgroup %}</code></p>

<p>Same goes for <code>{{ entry.heading }}</code> This should be: <code>{{ row.heading }}</code></p>

<p>Copy should be: <code>{{ block.copy }}</code></p>

<p>Working with matrixes and Supertable's is hard in the beginning but you'll get the hang of it. </p>

<p>When you loop over you <code>{{ entry.about }}</code> you loop using a variable named <code>block</code>. that should be used for every field you want to output that's in the matrix field. Same goes for SuperTable's only just one layer deeper.</p>

CC BY-SA 3.0
2017-01-07T00:32:24.603Z
Thank you! Had to change the switch statement also to '{% switch block.type %}' . I couldnt understand how to use SuperTable but seems so simple now, thanks!
Spheriri
CC BY-SA 3.0
2017-01-04T16:31:32.487Z
2017-01-04T16:31:32.487Z
Justin Dekkers
<p>As an added bonus, this is documented on the Super Table plugin Github page - <a href="https://github.com/engram-design/SuperTable#documentation" rel="nofollow noreferrer">https://github.com/engram-design/SuperTable#documentation</a></p>

<p>Specifically the <code>Matrix in Super Table field</code> - <a href="https://github.com/engram-design/SuperTable/wiki/Templating-examples#matrix-in-super-table-field" rel="nofollow noreferrer">https://github.com/engram-design/SuperTable/wiki/Templating-examples#matrix-in-super-table-field</a> - although I'm aware that the question was for a Super Table in Matrix field - its more than enough to get started. Glad you got it solved!</p>

CC BY-SA 3.0
2017-01-09T14:56:09.083Z
2017-01-09T14:56:09.083Z
crawf
<p>after searching around for awhile I still cannot find a clear answer to templating Supertables within a matrix field.</p>

<p>I have a field called 'about' which is the matrix field, within that there is a block called 'biography' which holds both a Rich Text Field called 'copy', and a SuperTable field called hgroup, within hgroup there is a plain text field called heading. How do I go about outputting these within the template.</p>

<p>There are other blocks, similar to 'biography', but I'm encountering the same issue with them.</p>

<p>I'm still very new to CraftCMS so some of this has me puzzled.</p>

<pre><code>{% block content %}
  {% for block in entry.about %}
    {% switch entry.about %}
        {% case 'biography' %}
          &lt;section&gt;
            &lt;div class="contain"&gt;
              &lt;article&gt;
                {% for row in entry.hgroup %}
                  &lt;header&gt;
                    &lt;h3&gt;{{ entry.heading }}&lt;/h3&gt;
                  &lt;/header&gt;
                {% endfor %}
                  {{ entry.copy }}
              &lt;/article&gt;
            &lt;/div&gt;
          &lt;/section&gt;
    {% endswitch %}
  {% endfor %}
{% endblock %}
</code></pre>

<p>Thanks.</p>

<templating><plugins><craft-features><plugin-supertable>
Outputting supertables within a matrix
# Outputting supertables within a matrix

(Asked by: username_0 on 2017-01-04)

after searching around for awhile I still cannot find a clear answer to templating Supertables within a matrix field.
I have a field called 'about' which is the matrix field, within that there is a block called 'biography' which holds both a Rich Text Field called 'copy', and a SuperTable field called hgroup, within hgroup there is a plain text field called heading. How do I go about outputting these within the template.
There are other blocks, similar to 'biography', but I'm encountering the same issue with them.
I'm still very new to CraftCMS so some of this has me puzzled.
{% block content %}
  {% for block in entry.about %}
    {% switch entry.about %}
        {% case 'biography' %}
          
            
              
                {% for row in entry.hgroup %}
                  
                    {{ entry.heading }}
                  
                {% endfor %}
                  {{ entry.copy }}
              
            
          
    {% endswitch %}
  {% endfor %}
{% endblock %}

Thanks.

**Tags:** templating, plugins, craft-features, plugin-supertable


---

## 2 answers

### Answer by username_1 on 2017-01-04. Score: 1 | Accepted answer

I think your output is wrong. Looking at your code and explanation, `{% for row in entry.hgroup %}` should be: `{% for row in block.hgroup %}`

Same goes for `{{ entry.heading }}` This should be: `{{ row.heading }}`

Copy should be: `{{ block.copy }}`

Working with matrixes and Supertable's is hard in the beginning but you'll get the hang of it.

When you loop over you `{{ entry.about }}` you loop using a variable named `block`. that should be used for every field you want to output that's in the matrix field. Same goes for SuperTable's only just one layer deeper.

> **Comments:**
> **username_0**: Thank you! Had to change the switch statement also to '{% switch block.type %}' . I couldnt understand how to use SuperTable but seems so simple now, thanks!  

---

### Answer by username_2 on 2017-01-09. Score: 1

As an added bonus, this is documented on the Super Table plugin Github page - <https://github.com/engram-design/SuperTable#documentation>

Specifically the `Matrix in Super Table field` - <https://github.com/engram-design/SuperTable/wiki/Templating-examples#matrix-in-super-table-field> - although I'm aware that the question was for a Super Table in Matrix field - its more than enough to get started. Glad you got it solved!


---

