<p>You need to use the <a href="https://docs.craftcms.com/v3/relations.html#the-relatedto-parameter" rel="nofollow noreferrer">relatedTo</a> parameter</p>

<pre class="lang-TWIG prettyprint-override"><code>{% for entry in craft.entries.relatedTo(block).section('sessionTiles').all() %}
</code></pre>

<p>or even more simple the <a href="https://docs.craftcms.com/v3/relations.html#getting-target-elements-via-the-source-element" rel="nofollow noreferrer">short syntax</a></p>

<pre class="lang-TWIG prettyprint-override"><code>{% for sessionTile in block.blockTilesContent.all() %}
</code></pre>

CC BY-SA 4.0
2019-03-21T13:29:38.450Z
Thank you @Robin! The relatedTo parameter has it showing the selected entries.
user9494
CC BY-SA 4.0
2019-03-21T07:40:47.303Z
2019-03-21T07:40:47.303Z
Robin Schambach
<p>I am new to craft and twig and need some help showing only added entries to matrix block. What I have now is showing all entries from the section. I may be going about this all wrong, I don't know. I have 11 entries but only want to show the 6 I have added to the block.</p>

<p><a href="https://i.sstatic.net/9T44n.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9T44n.png" alt="enter image description here"></a></p>

<p><a href="https://i.sstatic.net/BJ70j.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BJ70j.png" alt="enter image description here"></a></p>

<pre><code>    {% for block in entry.sessionsContent.all() %}

{% switch block.type %}

    {% case "sessionsHeader" %}
    &lt;section class="small-header" style="background-image: url({{ siteUrl }}/images/background-images{{ block.backgroundImage.one().getUrl() }});"&gt;
        &lt;div class="inner"&gt;
        &lt;div class="small-header-title"&gt;
            &lt;h1&gt;{{ block.headerTitle }}&lt;/h1&gt;
        &lt;/div&gt;
        &lt;/div&gt;
    &lt;/section&gt;

    {% case "sessionsIntro" %}
    &lt;div class="sessions-intro"&gt;
            &lt;div class="intro-title"&gt;
                &lt;h2&gt;{{ block.introTitle }}&lt;/h2&gt;
            &lt;/div&gt;
            &lt;div class="intro-description"&gt;
                &lt;p&gt;{{ block.introDescription }}&lt;/p&gt;
            &lt;/div&gt;
    &lt;/div&gt;

    {% case "sideBlock" %}
    {% if block.isWhiteBackground %}
        {% set divColor = 'white-background' %}
    {% endif %}
    {% if block.isBlockOnTheRight %}
        {% set divPosition = 'float-right' %}
    {% endif %}
    &lt;div class="side-block" style="background-image: url({{ siteUrl }}/images/background-images{{ block.blockBackgroundImage.one().getUrl() }})"&gt;
        &lt;div class="standard_wrapper {{divPosition}} {{divColor}}"&gt;
            &lt;div class="inner"&gt;
                &lt;div class="block-title"&gt;&lt;h2&gt;{{ block.blockTitle }}&lt;/h2&gt;&lt;/div&gt;
                &lt;div class="block-teaser"&gt;&lt;p&gt;{{ block.blockTeaser }}&lt;/p&gt;&lt;/div&gt;
                &lt;div class="block-description"&gt;
                    &lt;p&gt;{{ block.blockDescription }}&lt;/p&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;


    {% case "backgroundImageDivider" %}
    &lt;div class="divider" style="background-image: url({{ siteUrl }}/images/background-images{{ block.backgroundImage.one().getUrl() }});"&gt;
        &lt;div class="standard-wrapper"&gt;
        &lt;h2 class="divider-title"&gt;{{ block.dividerTitle }}&lt;/h2&gt;
        &lt;div class="divider-description"&gt;{{ block.dividerDescription }}&lt;/div&gt;
        &lt;div class="button-block"&gt;{{ block.button }}&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    {% case "blockTiles" %}
    &lt;div class="block-inner"&gt;
    {% for entry in craft.entries.section('sessionTiles').all() %}
    &lt;div class="sessions-block"&gt;
            &lt;img src="{{ siteUrl }}/images/session-images{{ entry.sessionTileImage.one().getUrl() }}" /&gt;
            &lt;div class="inner-text"&gt;
                &lt;h5 class="sessions-title"&gt;{{ entry.sessionTileTitle }}&lt;/h5&gt;
                &lt;div class="sessions-description"&gt;{{ entry.sessionTileDescription }}&lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    {% endfor %}
    &lt;/div&gt;

    {% default %}

{% endswitch %}
{% endfor %}
</code></pre>

<entries><matrix>
Entries Field Type showing all entries instead of entries selected
# Entries Field Type showing all entries instead of entries selected

(Asked by: username_0 on 2019-03-20)

I am new to craft and twig and need some help showing only added entries to matrix block. What I have now is showing all entries from the section. I may be going about this all wrong, I don't know. I have 11 entries but only want to show the 6 I have added to the block.


    {% for block in entry.sessionsContent.all() %}

{% switch block.type %}

    {% case "sessionsHeader" %}
    
        
        
            {{ block.headerTitle }}
        
        
    

    {% case "sessionsIntro" %}
    
            
                {{ block.introTitle }}
            
            
                {{ block.introDescription }}
            
    

    {% case "sideBlock" %}
    {% if block.isWhiteBackground %}
        {% set divColor = 'white-background' %}
    {% endif %}
    {% if block.isBlockOnTheRight %}
        {% set divPosition = 'float-right' %}
    {% endif %}
    
        
            
                {{ block.blockTitle }}
                {{ block.blockTeaser }}
                
                    {{ block.blockDescription }}
                
            
        
    


    {% case "backgroundImageDivider" %}
    
        
        {{ block.dividerTitle }}
        {{ block.dividerDescription }}
        {{ block.button }}
        
    

    {% case "blockTiles" %}
    
    {% for entry in craft.entries.section('sessionTiles').all() %}
    
            
            
                {{ entry.sessionTileTitle }}
                {{ entry.sessionTileDescription }}
            
        
    {% endfor %}
    

    {% default %}

{% endswitch %}
{% endfor %}

**Tags:** entries, matrix


---

## 1 answers

### Answer by username_1 on 2019-03-21. Score: 1 | Accepted answer

You need to use the relatedTo parameter
{% for entry in craft.entries.relatedTo(block).section('sessionTiles').all() %}

or even more simple the short syntax
{% for sessionTile in block.blockTilesContent.all() %}

> **Comments:**
> **username_0**: Thank you @Robin! The relatedTo parameter has it showing the selected entries.  

---

