Answers.Body: <p>I have not worked with Lowblocks yet, but it looks like it returns an array of Matrix block models. To get to the related entries you need to access the <code>owner</code> property.</p>
  
  <pre><code>{% set entryIds = [] %}
  {% for sown in allSown %}
      {% set blockId = sown.id %}
      {% set entryIds = entryIds|merge([blockId.owner.id]) %}
  {% endfor %}
  </code></pre>
  
  <p>But do you really need those entry IDs? You could just display the blocks?</p>
  
  <pre><code>{% for sown in allSown %}
      {{ sown.owner.title }}
      {{ sown.sowingLocation }}
      {{ sown.sowingDate }}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-31T07:26:11.733Z
Answers.Text: hmm tried that but I am getting this: Object of class Craft\ElementCriteriaModel could not be converted to string
  
  /home/aaronjay/craft/templates/index.html(-1)
Answers.UserDisplayName: Aaron
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-31T07:30:09.430Z
Answers.Text: What gives you this error? The line you print owner.title?
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-31T07:35:02.650Z
Answers.Text: nah the date - {{ sown.sowingDate|date("d - M") }}  this resolved it when I take the {{ sown.sowingLocation }} out.
Answers.UserDisplayName: Aaron
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-30T23:26:13.390Z
Answers.LastActivityDate: 2015-03-30T23:34:47.547Z
Answers.LastEditDate: 2015-03-30T23:34:47.547Z
Answers.UserDisplayName: carlcs
Body: <p>I have an entries in a section called 'garden', with a matrix field called 'sowing' - this matrix has a block called 'locationDate' and two fields 'sowingDate' and 'sowingLocation'.</p>
  
  <p>I want to loop through and show the last 5 things sown in the garden, so based on other examples and using low blocks, I have this code:</p>
  
  <pre><code>{% set allSown = craft.lowblocks.blocks.fieldId(12).type("locationDate").order("sowingDate").limit(5) %}
  {% set entryIds = [] %}
  
  {% for sown in allSown %}
      {% set entry = sown.title %}
      {% set entryIds = entryIds | merge([entry.id]) %}
  {% endfor %}
  
  {% set entries = craft.entries.section("garden").id(entryIds).fixedOrder(true).status("live,pending") %}
  
  {% for sown in entries %}
      {{ sown.title }}&lt;br /&gt;
  {% endfor %}
  </code></pre>
  
  <p>So my question is, why can't I view the entries, and what do I need to do to display the date of the matrix field? It seems like it should working, but I am missing something for sure. </p>
  
  <p>** note I need to have a matix date there as there are often multiple sowing locations and dates per entry. </p>
  
Tags: <matrix><datetime>
Title: How do I sort and display by a matrix date field?
ThreadText: # How do I sort and display by a matrix date field?
  
  (Asked by: username_0 on 2015-03-30)
  
  I have an entries in a section called 'garden', with a matrix field called 'sowing' - this matrix has a block called 'locationDate' and two fields 'sowingDate' and 'sowingLocation'.
  
  I want to loop through and show the last 5 things sown in the garden, so based on other examples and using low blocks, I have this code:
  
  ```
  {% set allSown = craft.lowblocks.blocks.fieldId(12).type("locationDate").order("sowingDate").limit(5) %}
  {% set entryIds = [] %}
  
  {% for sown in allSown %}
      {% set entry = sown.title %}
      {% set entryIds = entryIds | merge([entry.id]) %}
  {% endfor %}
  
  {% set entries = craft.entries.section("garden").id(entryIds).fixedOrder(true).status("live,pending") %}
  
  {% for sown in entries %}
      {{ sown.title }}<br />
  {% endfor %}
  
  ```
  
  So my question is, why can't I view the entries, and what do I need to do to display the date of the matrix field? It seems like it should working, but I am missing something for sure.
  
  \*\* note I need to have a matix date there as there are often multiple sowing locations and dates per entry.
  
  **Tags:** matrix, datetime
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-03-30. Score: 2 | Accepted answer
  
  I have not worked with Lowblocks yet, but it looks like it returns an array of Matrix block models. To get to the related entries you need to access the `owner` property.
  
  ```
  {% set entryIds = [] %}
  {% for sown in allSown %}
      {% set blockId = sown.id %}
      {% set entryIds = entryIds|merge([blockId.owner.id]) %}
  {% endfor %}
  
  ```
  
  But do you really need those entry IDs? You could just display the blocks?
  
  ```
  {% for sown in allSown %}
      {{ sown.owner.title }}
      {{ sown.sowingLocation }}
      {{ sown.sowingDate }}
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: hmm tried that but I am getting this: Object of class Craft\ElementCriteriaModel could not be converted to string  /home/aaronjay/craft/templates/index.html(-1)  
  > **username_1**: What gives you this error? The line you print owner.title?  
  > **username_0**: nah the date - {{ sown.sowingDate|date("d - M") }}  this resolved it when I take the {{ sown.sowingLocation }} out.  
  
  ---
  
  