2

I'm using the SuperTable plugin to create Matrix fields inside a super Table. It's looking great in the front-end but I can't find any documentation on how to template the fields. This is my code so far:

            <div class="article-blocks">
            {% for block in entry.informasjon %}

                {% if block.type == "innhold" %}

                    {% for row in entry.velg1Av3BildeVideo %}

                        <div class="image-container">
                            {% for image in entry.bilde1 %}
                                <img src="/{{ image.getUrl('artikkelBlokk1Lite') }}" alt="{{ image.title }}" />
                            {% endfor %}
                            {% for image in entry.bilde2 %}
                                <img src="/{{ image.getUrl('artikkelBlokk1Stor') }}" alt="{{ image.title }}" />
                            {% endfor %}
                        </div>

                    {% endfor %}     

                {% endif %}  

            {% endfor %}
            </div>
8

There's no block types with SuperTable, so no need to check that. Other that that it works just the same as Matrix fields.

{% for row in superTableField %}
    {{ row.textFieldInSuperTableField }}
{% endfor %}
| improve this answer | |
1

There are a few templating examples via the documentation - https://verbb.io/craft-plugins/super-table/docs/guides/templating-examples

But as @carlcs states, I believe the issue is that you're checking {% if block.type == "innhold" %} which will fail, as a SuperTableBlock doesn't have an attribute type at all, unlike Matrix.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.