Answers.Body: <p>You will need to use your Matrix field handle (which you didn't show in your question) and replace <code>yourMatrixFieldHandle</code>:</p>
  
  <pre><code>{% for client in clients %}
      {{ client.title }}
  
      {# Get all blocks related to the client entry #}
      {% for block in client.yourMatrixFieldHandle.all() %}
  
          {% switch block.type %}
  
              {% case "clientImage" %}
  
                  {% for image in block.clientImage.all() %}
                      &lt;img src="{{ image.getUrl() }}" alt="{{ image.title }}"&gt;
                  {% endfor %}
  
              {% case "clientDescription" %}
  
                  {{ block.clientDescription }}
  
          {% endswitch %}
  
      {% endfor %}
  
  {% endfor %}
  </code></pre>
  
  <p>Read more about <a href="https://docs.craftcms.com/v3/matrix-fields.html#working-with-matrix-field-data" rel="nofollow noreferrer">working with Matrix fields here</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-04T14:50:33.020Z
Answers.Text: it works! thank you very much
Answers.UserDisplayName: Cosmin Ciolacu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-04T14:09:46.037Z
Answers.LastActivityDate: 2020-05-04T14:09:46.037Z
Answers.UserDisplayName: Oli
Body: <p>I create a section clientSection which I linked an matrix field like in this image:
  <a href="https://i.sstatic.net/uCDxI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/uCDxI.png" alt="screenshot"></a>
  The field has two block types : <code>clientImage</code> which has an field <code>clientImage</code> and <code>clientDescription</code> which has an field with same name.
  I want to output in twig file but I don't know how exactly</p>
  
  <pre><code>{% set clients = craft.entries.section('clientSection').all() %}
  
  {% for client in clients %}
    {# display content here #}
  {% endfor %}
  </code></pre>
  
  <p>Thank's</p>
  
Tags: <entries><matrix>
Title: retrieve matrix data to twig file
ThreadText: # retrieve matrix data to twig file
  
  (Asked by: username_0 on 2020-05-04)
  
  I create a section clientSection which I linked an matrix field like in this image:
  [![screenshot](https://i.sstatic.net/uCDxI.png)](https://i.sstatic.net/uCDxI.png)
  The field has two block types : `clientImage` which has an field `clientImage` and `clientDescription` which has an field with same name.
  I want to output in twig file but I don't know how exactly
  
  ```
  {% set clients = craft.entries.section('clientSection').all() %}
  
  {% for client in clients %}
    {# display content here #}
  {% endfor %}
  
  ```
  
  Thank's
  
  **Tags:** entries, matrix
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-05-04. Score: 1 | Accepted answer
  
  You will need to use your Matrix field handle (which you didn't show in your question) and replace `yourMatrixFieldHandle`:
  
  ```
  {% for client in clients %}
      {{ client.title }}
  
      {# Get all blocks related to the client entry #}
      {% for block in client.yourMatrixFieldHandle.all() %}
  
          {% switch block.type %}
  
              {% case "clientImage" %}
  
                  {% for image in block.clientImage.all() %}
                      <img src="{{ image.getUrl() }}" alt="{{ image.title }}">
                  {% endfor %}
  
              {% case "clientDescription" %}
  
                  {{ block.clientDescription }}
  
          {% endswitch %}
  
      {% endfor %}
  
  {% endfor %}
  
  ```
  
  Read more about [working with Matrix fields here](https://docs.craftcms.com/v3/matrix-fields.html#working-with-matrix-field-data)
  
  > **Comments:**
  > **username_0**: it works! thank you very much  
  
  ---
  
  