Answers.Body: <p>According to the documentation, I just have to pass the matrix fields handle <code>block</code> instead of <code>block.tabEntry</code>. Craft will automatically look for a relationship field (how smart). If you have multiple relation fields, you have to  use the dot notation with the field name. (→ see <a href="https://craftcms.com/docs/relations" rel="nofollow">Relations – Going Through Matrix</a>)</p>
  
  <p>I still don't understand why using the dot notation would break it, but it apparently does. I checked my field name several times. Anywho, thanks for the help all! </p>
  
  <pre><code>{% for block in entry.contentMatrix %}
  
    {# Tabs Block Type #}
    {% if block.type == "tabs" %}
    {% set entries = craft.entries.relatedTo(block) %}
  
      {% for entry in entries %}
        {# Matrix Content #}
        {% for block in entry.tabsMatrix.type('videoChannel, videoPlayer, copy') %}
          {{ block.title }}
        {% endfor %}
      {% endfor %}
    {% endif %}
  
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T16:09:04.003Z
Answers.LastActivityDate: 2016-01-27T17:20:55.173Z
Answers.LastEditDate: 2016-01-27T17:20:55.173Z
Answers.UserDisplayName: Ben Shoults
Answers.Body: <p>Do you need to <a href="https://craftcms.com/docs/matrix-fields#filtering-by-block-type" rel="nofollow">filter by block type</a>?</p>
  
  <p>Maybe something like this:</p>
  
  <pre><code>{% for block in entry.contentMatrix %}
  
      {# Tabs Block Type #}
      {% if block.type == "tabs" %}
  
          {% set entries = craft.entries.relatedTo(block.tabEntry) %}
  
          {% for entry in entries %}
              {# Matrix Content #}
              {% for content in entry.tabsMatrix.type('videoChannel, videoPlayer, copy') %}
  
                  {% if content.type == "videoChannel" %}
                      {{ content.title }}
                  {% elseif content.type == "videoPlayer" %}
                      {{ content.url }}
                  {% else %}
                      {{ content.text }}
                  {% endif %}
  
              {% endfor %}
  
          {% endfor %}
  
      {% endif %}
  
  {% endfor %}
  </code></pre>
  
  <p>Note: Matrix Content vars (*.title, *url, *text) are just examples.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T16:04:13.377Z
Answers.Text: My understanding is that we can add type to the `for` to choose multiple matrix types.
Answers.UserDisplayName: Ben Shoults
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-26T23:26:03.113Z
Answers.LastActivityDate: 2016-01-26T23:26:03.113Z
Answers.UserDisplayName: Natetronn
Body: <p>I have a matrix field with an entries field which ties into another matrix field. Is this possible? Here's what I have so far...</p>
  
  <pre><code>{% for block in entry.contentMatrix %}
  
    {# Tabs Block Type #}
    {% if block.type == "tabs" %}
      {% set entries = craft.entries.relatedTo(block.tabEntry) %}
  
      {% for entry in entries %}
        {# Matrix Content #}
        {% for block in entry.tabsMatrix.type('videoChannel, videoPlayer, copy') %}
          {{ block.title }}
        {% endfor %}
      {% endfor %}
    {% endif %}
  
  {% endfor %}
  </code></pre>
  
  <p>This does not produce an error, just nothing.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-26T22:34:58.253Z
Comments.Text: As an aside, is the `switch` tag better suited than the conditional for looping through the block types? Is there a performance difference?
Comments.UserDisplayName: Ben Shoults
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-26T23:14:19.520Z
Comments.Text: No performance difference in conditional vs switch. Switch is just a bit cleaner sometimes.
Comments.UserDisplayName: Douglas McDonald
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-26T23:27:20.667Z
Comments.Text: Your code looks ok to me. You might want to dump variables (or test length) within each loop to see if your getting results. i.e. `{{ dump(entries) }}` or `{{ entries|length }}`
Comments.UserDisplayName: Douglas McDonald
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-27T16:10:38.997Z
Comments.Text: The dump helped me realize that nothing was getting passed before getting to the matrix loop...thanks
Comments.UserDisplayName: Ben Shoults
Tags: <entries><matrix>
Title: Is Matrix > Entries > Matrix possible?
ThreadText: # Is Matrix > Entries > Matrix possible?
  
  (Asked by: username_0 on 2016-01-26)
  
  I have a matrix field with an entries field which ties into another matrix field. Is this possible? Here's what I have so far...
  
  ```
  {% for block in entry.contentMatrix %}
  
    {# Tabs Block Type #}
    {% if block.type == "tabs" %}
      {% set entries = craft.entries.relatedTo(block.tabEntry) %}
  
      {% for entry in entries %}
        {# Matrix Content #}
        {% for block in entry.tabsMatrix.type('videoChannel, videoPlayer, copy') %}
          {{ block.title }}
        {% endfor %}
      {% endfor %}
    {% endif %}
  
  {% endfor %}
  
  ```
  
  This does not produce an error, just nothing.
  
  **Tags:** entries, matrix
  
  > **Comments:**
  > **username_0**: As an aside, is the `switch` tag better suited than the conditional for looping through the block types? Is there a performance difference?  
  > **username_1**: No performance difference in conditional vs switch. Switch is just a bit cleaner sometimes.  
  > **username_1**: Your code looks ok to me. You might want to dump variables (or test length) within each loop to see if your getting results. i.e. `{{ dump(entries) }}` or `{{ entries|length }}`  
  > **username_0**: The dump helped me realize that nothing was getting passed before getting to the matrix loop...thanks  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2016-01-27. Score: 1 | Accepted answer
  
  According to the documentation, I just have to pass the matrix fields handle `block` instead of `block.tabEntry`. Craft will automatically look for a relationship field (how smart). If you have multiple relation fields, you have to use the dot notation with the field name. (→ see [Relations – Going Through Matrix](https://craftcms.com/docs/relations))
  
  I still don't understand why using the dot notation would break it, but it apparently does. I checked my field name several times. Anywho, thanks for the help all!
  
  ```
  {% for block in entry.contentMatrix %}
  
    {# Tabs Block Type #}
    {% if block.type == "tabs" %}
    {% set entries = craft.entries.relatedTo(block) %}
  
      {% for entry in entries %}
        {# Matrix Content #}
        {% for block in entry.tabsMatrix.type('videoChannel, videoPlayer, copy') %}
          {{ block.title }}
        {% endfor %}
      {% endfor %}
    {% endif %}
  
  {% endfor %}
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2016-01-26. Score: 1
  
  Do you need to [filter by block type](https://craftcms.com/docs/matrix-fields#filtering-by-block-type)?
  
  Maybe something like this:
  
  ```
  {% for block in entry.contentMatrix %}
  
      {# Tabs Block Type #}
      {% if block.type == "tabs" %}
  
          {% set entries = craft.entries.relatedTo(block.tabEntry) %}
  
          {% for entry in entries %}
              {# Matrix Content #}
              {% for content in entry.tabsMatrix.type('videoChannel, videoPlayer, copy') %}
  
                  {% if content.type == "videoChannel" %}
                      {{ content.title }}
                  {% elseif content.type == "videoPlayer" %}
                      {{ content.url }}
                  {% else %}
                      {{ content.text }}
                  {% endif %}
  
              {% endfor %}
  
          {% endfor %}
  
      {% endif %}
  
  {% endfor %}
  
  ```
  
  Note: Matrix Content vars (\*.title, \*url, \*text) are just examples.
  
  > **Comments:**
  > **username_0**: My understanding is that we can add type to the `for` to choose multiple matrix types.  
  
  ---
  
  