I’m trying to output a list of parent relationships and fire a closing </div> tag. The problem is I’m getting the </div> tag after the 1st entry, not the final entry. If I place an integer into the count statement that equals the total entries, it works. But, of course, I need a dynamic solution that recognizes the final entry.
This is what I’m trying to do:
{parents field="movie_links_relate" status="not closed"}
{if parents:count == "1"}
<div id="related_posts" class="theme_article">
<div class="subtitle_area">
<h3 class="post_related_title theme_subtitle">Related news about <em>{title}</em>
</h3>
</div>
{/if}
<div class="related_posts_item related_post_item_{parents:count} post_thumb down-1">
<a href="http://{parents:title_permalink=">_ </a>
<div class="post_content_wrapper theme_puzzles" data-puzzlecolor="{exp:randomizer:set_three}">
<h3 class="post_subtitle"><a href="http://{parents:title_permalink=">{parents:title}</a>
</h3>
<div class="reviews_summary blog_reviews theme_puzzles">
<div class="criteria_summary criteria_row">
</div>
</div>
<div class="post_descr">{parents:pull_quote}
</div>
<div class="post_content_padding theme_puzzles">
</div>
</div>
</div>
{if parents:count == total_results}
</div>
{/if}
{/parents}
I’m running EE 3.5.7
Thank you!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.