<p>I'm not sure that .entry is a valid parameter? I think that craft.entries.section('kontakt') contains an array with entries, so maybe you you could do .first on it, so basically I think you wanted to do this:</p>

<pre><code>    {% for kontaktEntry in craft.entries.section('kontakt').first.kontakter %}
        &lt;div&gt;
            &lt;a href="{{ kontaktEntry.epost }}"&gt;
                {% set image = kontaktEntry.bilde.first() %}
                {% if image %}
                    &lt;img src="{{ image.getUrl() }}" width="100" height="100" alt="{{kontaktEntry.navn}}"/&gt;
                {% endif %}
                &lt;h3 class="center"&gt;{{ kontaktEntry.navn }}&lt;/h3&gt;
                {{ kontaktEntry.stilling }}
            &lt;/a&gt;
        &lt;/div&gt;
    {% endfor %}
</code></pre>

CC BY-SA 3.0
2017-08-15T07:09:32.987Z
2017-08-15T07:09:32.987Z
Youniteus
<p>I need to get data from fields from another section. 
My code is:</p>

<pre><code>        {% for kontaktEntry in craft.entries.section('kontakt').entry.kontakter %}
            &lt;div&gt;
                &lt;a href="{{ kontaktEntry.epost }}"&gt;
                    {% set image = kontaktEntry.bilde.first() %}
                    {% if image %}
                        &lt;img src="{{ image.getUrl() }}" width="100" height="100" alt="{{kontaktEntry.navn}}"/&gt;
                    {% endif %}
                    &lt;h3 class="center"&gt;{{ kontaktEntry.navn }}&lt;/h3&gt;
                    {{ kontaktEntry.stilling }}
                &lt;/a&gt;
            &lt;/div&gt;
        {% endfor %}
</code></pre>

<p>kontakter is a matrix. I get nothing in output. What is wrong here? </p>

CC BY-SA 3.0
2017-08-14T19:03:47.893Z
I'm not sure that `.entry` is a valid parameter? I think that `craft.entries.section('kontakt')` contains an array with entries, so maybe you you could do `.first` on it?
Youniteus
CC BY-SA 3.0
2017-08-14T21:37:05.030Z
Thank you, Youniteus! You are right! Publish it as an answer, so it will be voted up. craft.entries.section('kontakt').first.kontakter is a correct code.
podeig
<matrix><entry><sections>
How to get fields from another section?
# How to get fields from another section?

(Asked by: username_0 on 2017-08-14)

I need to get data from fields from another section. 
My code is:
        {% for kontaktEntry in craft.entries.section('kontakt').entry.kontakter %}
            
                
                    {% set image = kontaktEntry.bilde.first() %}
                    {% if image %}
                        
                    {% endif %}
                    {{ kontaktEntry.navn }}
                    {{ kontaktEntry.stilling }}
                
            
        {% endfor %}

kontakter is a matrix. I get nothing in output. What is wrong here?

**Tags:** matrix, entry, sections

> **Comments:**
> **username_1**: I'm not sure that `.entry` is a valid parameter? I think that `craft.entries.section('kontakt')` contains an array with entries, so maybe you you could do `.first` on it?  
> **username_0**: Thank you, username_1! You are right! Publish it as an answer, so it will be voted up. craft.entries.section('kontakt').first.kontakter is a correct code.  

---

## 1 answers

### Answer by username_1 on 2017-08-15. Score: 3 | Accepted answer

I'm not sure that .entry is a valid parameter? I think that craft.entries.section('kontakt') contains an array with entries, so maybe you you could do .first on it, so basically I think you wanted to do this:
    {% for kontaktEntry in craft.entries.section('kontakt').first.kontakter %}
        
            
                {% set image = kontaktEntry.bilde.first() %}
                {% if image %}
                    
                {% endif %}
                {{ kontaktEntry.navn }}
                {{ kontaktEntry.stilling }}
            
        
    {% endfor %}


---

