Answers.Body: <p>I think you'll need to remove the <code>first()</code> part. Then your twig will look something like this...</p>
  
  <pre><code>&lt;ul class="footlist"&gt;
      &lt;li class="foottitle"&gt;{{ block.navSection }}&lt;/li&gt;
          {% if block.type == "footerCategory" %}
              {% set pages = block.page %}
              {% if pages|length %}
                  {% for page in pages %}
                      &lt;li&gt;{{ page.title }}&lt;/li&gt;
                  {% endfor %}
              {% end if %}
          {% endif %}
      &lt;/li&gt; 
  &lt;/ul&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-20T16:34:55.987Z
Answers.Text: Holy smokes that worked! Thanks!
  Didnt think i would need that extra if and for, but it works!
Answers.UserDisplayName: kingkelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-20T04:12:35.487Z
Answers.LastActivityDate: 2017-10-20T04:12:35.487Z
Answers.UserDisplayName: Damon
Answers.Body: <p>The elementCriteriaModel is a class/object that handles your search. It's a class that combines multiple methods to fetch entries from your database with an iterable interface on it.</p>
  
  <p>That means: when you receive an entry you get all the queries you need attached to it to pull all the relationship instead of loading all the other entries all the time. So entry.matrix is nothing but database command to pull the other entries which makes craft fast. Otherwise you would take much more time.</p>
  
  <p>To make it short: when you loop through your elementCriteriaModel the method <code>.find()</code> is executed, that fetches all your entries and return them as an array. The method first() returns only the first element, last() returns only the last element.</p>
  
  <p>In order to pull all you just need to loop block.page
  <code>{% for entry in block.page %}</code> will to it </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-20T04:04:59.157Z
Answers.LastActivityDate: 2017-10-20T04:04:59.157Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I have an Entry field (page) as part of my Matrix field (footer).</p>
  
  <p>When the client selects 5 entries, I want to display them all in my list and not just the first. I can only seem to get my code working with .first or .last. Everything else I try gives me the old "Object of class Craft\ElementCriteriaModel could not be converted to string" error.</p>
  
  <pre><code>&lt;ul class="footlist"&gt;
      &lt;li class="foottitle"&gt;{{ block.navSection }}&lt;/li&gt;
          {% if block.type == "footerCategory" %}
          {% set page = block.page.first() %}
             &lt;li&gt;{{ page.title }}&lt;/li&gt;
          {% endif %} 
  &lt;/ul&gt;
  </code></pre>
  
  <p>My matrix for this list:
  <a href="https://i.sstatic.net/fI1Tm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fI1Tm.png" alt="enter image description here"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-20T03:53:16.960Z
Comments.Text: What happens if you remove the `first()`?
Comments.UserDisplayName: Damon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-20T16:35:12.697Z
Comments.Text: I get the error when i remove first
Comments.UserDisplayName: kingkelly
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-01-18T15:59:43.490Z
Comments.Text: I'm having a similar problem and any help would be greatful. I have this code: {% for entry in craft.entries.section('positions') %} <li class="list-item-career tooltip"> <div class="list-item__title" style="padding: 15px 0px;"> <div class="col-6">{{ entry.title }}</div> <div class="col-6">{{ entry.locationLink.first }}</div> </div>
  And this pulls my first entry just fine,. but i now need to list them all but when I change .first to .find() I get error. Can you please let me know what I might be doing wrong?
Comments.UserDisplayName: Joe
Tags: <matrix><entries-field>
Title: Show all entries from an entry field
ThreadText: # Show all entries from an entry field
  
  (Asked by: username_0 on 2017-10-20)
  
  I have an Entry field (page) as part of my Matrix field (footer).
  
  When the client selects 5 entries, I want to display them all in my list and not just the first. I can only seem to get my code working with .first or .last. Everything else I try gives me the old "Object of class Craft\ElementCriteriaModel could not be converted to string" error.
  
  ```
  <ul class="footlist">
      <li class="foottitle">{{ block.navSection }}</li>
          {% if block.type == "footerCategory" %}
          {% set page = block.page.first() %}
             <li>{{ page.title }}</li>
          {% endif %} 
  </ul>
  
  ```
  
  My matrix for this list:
  [![enter image description here](https://i.sstatic.net/fI1Tm.png)](https://i.sstatic.net/fI1Tm.png)
  
  **Tags:** matrix, entries-field
  
  > **Comments:**
  > **username_1**: What happens if you remove the `first()`?  
  > **username_0**: I get the error when i remove first  
  > **username_2**: I'm having a similar problem and any help would be greatful. I have this code: {% for entry in craft.entries.section('positions') %} <li class="list-item-career tooltip"> <div class="list-item__title" style="padding: 15px 0px;"> <div class="col-6">{{ entry.title }}</div> <div class="col-6">{{ entry.locationLink.first }}</div> </div> And this pulls my first entry just fine,. but i now need to list them all but when I change .first to .find() I get error. Can you please let me know what I might be doing wrong?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-10-20. Score: 1 | Accepted answer
  
  I think you'll need to remove the `first()` part. Then your twig will look something like this...
  
  ```
  <ul class="footlist">
      <li class="foottitle">{{ block.navSection }}</li>
          {% if block.type == "footerCategory" %}
              {% set pages = block.page %}
              {% if pages|length %}
                  {% for page in pages %}
                      <li>{{ page.title }}</li>
                  {% endfor %}
              {% end if %}
          {% endif %}
      </li> 
  </ul>
  
  ```
  
  > **Comments:**
  > **username_0**: Holy smokes that worked! Thanks! Didnt think i would need that extra if and for, but it works!  
  
  ---
  
  ### Answer by username_3 on 2017-10-20. Score: 1
  
  The elementCriteriaModel is a class/object that handles your search. It's a class that combines multiple methods to fetch entries from your database with an iterable interface on it.
  
  That means: when you receive an entry you get all the queries you need attached to it to pull all the relationship instead of loading all the other entries all the time. So entry.matrix is nothing but database command to pull the other entries which makes craft fast. Otherwise you would take much more time.
  
  To make it short: when you loop through your elementCriteriaModel the method `.find()` is executed, that fetches all your entries and return them as an array. The method first() returns only the first element, last() returns only the last element.
  
  In order to pull all you just need to loop block.page
  `{% for entry in block.page %}` will to it
  
  
  ---
  
  