<p>This can be done, but it does require additional calls to query this information. It might be more efficient to hard-code this text in your template, unless you really want to make this text dynamic.</p>

<p>There's two concepts here. When you call <code>entry.relatedArticleLinks</code> you're fetching Super Table blocks that are related to the entry in question. Calling <code>englishLinks</code> on each of these blocks will return the <strong>content</strong> for this field - nothing about the field definition itself, such as the handle, name, or settings - just the content. </p>

<p>What type of field is <code>englishLinks</code>?</p>

<p>If you wanted to grab the field definition as well, you can by calling:</p>

<pre><code>{% set field = craft.app.fields.getFieldByHandle('relatedArticleLinks') %}
{% set blocks = craft.superTable.getSuperTableBlocks(field.id) %}
{% set fields = blocks[0].getFields() %}

{{ fields.englishLinks.name }}
</code></pre>

CC BY-SA 4.0
2019-09-10T13:39:42.753Z
2019-09-10T13:39:42.753Z
crawf
<p>I have a Super Tables field, containing related entries:</p>

<p><a href="https://i.sstatic.net/0XlYZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0XlYZ.png" alt="Super Table with entries rows"></a></p>

<p>I'd like to display the field name (ie 'English Links') in a template, but can't figure out how, the following outputs a string of values and if I try to add a handle to the row output I get 'Impossible to access an attribute ("handle") on a string variable'.</p>

<pre><code>{% for row in entry.relatedArticleLinks %}
    {{ row }}
{% endfor %}
</code></pre>

<p>I really don't think this was written very well in the first place tbh, as the rows are hard coded:</p>

<pre><code>        &lt;div class="w-full md:w-1/3 my-1"&gt;
            &lt;h3&gt;English&lt;/h3&gt;
            &lt;ul class="list-reset"&gt;
            {% for link in entry.relatedArticleLinks.englishLinks %}
                &lt;li&gt;&lt;a href="{{ link.url }}" class="text-black text-sm"&gt;{{ link.title }}&lt;/a&gt;&lt;/li&gt;    
            {% endfor %}
            &lt;/ul&gt;
        &lt;/div&gt;
</code></pre>

<p>I'm sure there's a better way of displaying this field which would allow new rows to be displayed automatically?</p>

CC BY-SA 4.0
2019-09-10T07:41:43.460Z
What type of field is English Links? Seem like a some kind of repeatable field with a "link" and "url?"
Alex Roper
<craft2><plugin-supertable>
Looping Entries in Super Table, display row details
# Looping Entries in Super Table, display row details

(Asked by: username_0 on 2019-09-07)

I have a Super Tables field, containing related entries:

I'd like to display the field name (ie 'English Links') in a template, but can't figure out how, the following outputs a string of values and if I try to add a handle to the row output I get 'Impossible to access an attribute ("handle") on a string variable'.
{% for row in entry.relatedArticleLinks %}
    {{ row }}
{% endfor %}

I really don't think this was written very well in the first place tbh, as the rows are hard coded:
        
            English
            
            {% for link in entry.relatedArticleLinks.englishLinks %}
                {{ link.title }}    
            {% endfor %}
            
        

I'm sure there's a better way of displaying this field which would allow new rows to be displayed automatically?

**Tags:** craft2, plugin-supertable
> **Comments:**
> **username_1**: What type of field is English Links? Seem like a some kind of repeatable field with a "link" and "url?"  

---

## 1 answers

### Answer by username_2 on 2019-09-10. Score: 1

This can be done, but it does require additional calls to query this information. It might be more efficient to hard-code this text in your template, unless you really want to make this text dynamic.
There's two concepts here. When you call entry.relatedArticleLinks you're fetching Super Table blocks that are related to the entry in question. Calling englishLinks on each of these blocks will return the content for this field - nothing about the field definition itself, such as the handle, name, or settings - just the content. 
What type of field is englishLinks?
If you wanted to grab the field definition as well, you can by calling:
{% set field = craft.app.fields.getFieldByHandle('relatedArticleLinks') %}
{% set blocks = craft.superTable.getSuperTableBlocks(field.id) %}
{% set fields = blocks[0].getFields() %}

{{ fields.englishLinks.name }}


---

