<p>I'm building a property developers website and it has a carousel at the bottom of the individual property pages, in which I want to show five other related properties from the same group in the structure and not the entry on the current page also.</p>

<p>This is what I have currently in the code:</p>

<pre><code>{% for nextSibling in craft.entries.section('availablehomes').limit('5') %}
...content...
{% endfor %}
</code></pre>

<p>However, I've tried many different ways suggested, but I can only get it to show the current property in a continuous loop. So need some help please.</p>

<p>I've attached a screen shot of the carousel and the structure below.</p>

<p>So to clarify, when I'm in the page that's in Lockeswood / Plot 1, I'd like to show the other plots that are under it in the structure, and then if that is less than 5, I'd like it to include the next plots from level(2) in the structure to make it 5.</p>

<p>Cheers  </p>

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

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

<p>Update:</p>

<p>I've now got it to show entries listed after only, but still need it to show the entries within the relevant group in the structure first before showing other groups entries.</p>

<pre><code>{% set var = craft.entries.positionedAfter(entry).level('2') %}
{% for entry in var.limit('5') %}
&lt;div class="related-carousel-cell"&gt;
    &lt;div class="property"&gt;
        &lt;a href="{{ entry.url }}"&gt;
            &lt;div class="wrap"&gt;
                &lt;img src="{{ entry.plotGallery.first().getUrl('relatedArticlesLarge') }}" class="property-image img-responsive" alt="{{ entry.title }}"&gt;
            &lt;/div&gt;
            &lt;div class="text"&gt;
            &lt;h2&gt;{{ entry.parent ? entry.parent.title }} - &lt;span style="white-space: nowrap;"&gt;{{ entry.title }}&lt;/span&gt;&lt;/h2&gt;
            &lt;/div&gt;
        &lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
{% endfor %}
</code></pre>

<p>Which is outputting the following for Lockeswood / Plot 1, however, the Plot 2 page would not include Plot 1 in it's list as it's now only show entries after the current entry and not the whole group.</p>

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

CC BY-SA 3.0
2017-01-12T21:03:47.070Z
Can you share some of your internal `...content...` code? It might help debug what is happening.
Aaron Berkowitz
CC BY-SA 3.0
2017-01-12T21:05:57.697Z
<div class="related-carousel-cell">
        <div class="property">
            <a href="{{ entry.url }}">
                <div class="wrap">
                    <img src="{{ entry.plotGallery.first().getUrl('relatedArticlesLarge') }}" class="property-image img-responsive" alt="{{ entry.title }}">
                </div>
                <div class="text">
                <h2>{{ entry.parent ? entry.parent.title }} - <span style="white-space: nowrap;">{{ entry.title }}</span></h2>
                </div>
            </a>
    </div>
    </div>
mention79
CC BY-SA 3.0
2017-01-12T21:07:08.183Z
Instead of `entry`, use `nextSibling`. `entry` is the URL you are on, not the entry you are looking to show in your loop.
Aaron Berkowitz
CC BY-SA 3.0
2017-01-12T21:13:31.717Z
That's something that I tried originally unfortunately. But thanks for trying
mention79
CC BY-SA 3.0
2017-01-12T21:18:23.020Z
I'm having some success with: `{% set var = craft.entries.positionedAfter(entry).level('2') %}{% for entry in var.limit('5') %}
` but, it only adds the entries after the current entry. Whereas I need to include the other entries in the structure group first before showing other section in the structure.
mention79
CC BY-SA 3.0
2017-01-12T22:02:59.013Z
If you can, update your question with all your current code so we can take a closer look.
Aaron Berkowitz
<structure>
Related entries from level 2 in structure
# Related entries from level 2 in structure

(Asked by: username_0 on 2017-01-12)

I'm building a property developers website and it has a carousel at the bottom of the individual property pages, in which I want to show five other related properties from the same group in the structure and not the entry on the current page also.
This is what I have currently in the code:
{% for nextSibling in craft.entries.section('availablehomes').limit('5') %}
...content...
{% endfor %}

However, I've tried many different ways suggested, but I can only get it to show the current property in a continuous loop. So need some help please.
I've attached a screen shot of the carousel and the structure below.
So to clarify, when I'm in the page that's in Lockeswood / Plot 1, I'd like to show the other plots that are under it in the structure, and then if that is less than 5, I'd like it to include the next plots from level(2) in the structure to make it 5.
Cheers  


Update:
I've now got it to show entries listed after only, but still need it to show the entries within the relevant group in the structure first before showing other groups entries.
{% set var = craft.entries.positionedAfter(entry).level('2') %}
{% for entry in var.limit('5') %}

    
        
            
                
            
            
            {{ entry.parent ? entry.parent.title }} - {{ entry.title }}
            
        
    

{% endfor %}

Which is outputting the following for Lockeswood / Plot 1, however, the Plot 2 page would not include Plot 1 in it's list as it's now only show entries after the current entry and not the whole group.

**Tags:** structure
> **Comments:**
> **username_1**: Can you share some of your internal `...content...` code? It might help debug what is happening.  
> **username_0**: <div class="related-carousel-cell">         <div class="property">             <a href="{{ entry.url }}">                 <div class="wrap">                     <img src="{{ entry.plotGallery.first().getUrl('relatedArticlesLarge') }}" class="property-image img-responsive" alt="{{ entry.title }}">                 </div>                 <div class="text">                 <h2>{{ entry.parent ? entry.parent.title }} - <span style="white-space: nowrap;">{{ entry.title }}</span></h2>                 </div>             </a>     </div>     </div>  
> **username_1**: Instead of `entry`, use `nextSibling`. `entry` is the URL you are on, not the entry you are looking to show in your loop.  
> **username_0**: That's something that I tried originally unfortunately. But thanks for trying  
> **username_0**: I'm having some success with: `{% set var = craft.entries.positionedAfter(entry).level('2') %}{% for entry in var.limit('5') %} ` but, it only adds the entries after the current entry. Whereas I need to include the other entries in the structure group first before showing other section in the structure.  
> **username_1**: If you can, update your question with all your current code so we can take a closer look.  

---

## 0 answers

