I have a stash set list that's getting all the entries from a channel as follows;
{exp:stash:set_list name="items-{segment_2}" parse_tags="yes" parse_depth="3"}
{exp:tag:related_entries
channel="items"
orderby="title"
sort="asc"
}
{stash:item_id}{entry_id}{/stash:item_id}
{stash:item_title}{title}{/stash:item_title}
{stash:item_count}{count}{/stash:item_count}
{/exp:tag:related_entries}
{/exp:stash:set_list}
I'm then using a get list as follows, first to get the first 3 items and then again to get all the rest in the "more_items" div;
<h1>Items <a href="">View more</a></h1>
<div class="items">
{exp:stash:get_list name="items-{segment_2}" limit="3"}
{item_title}
{/exp:stash:get_list}
</div>
<div class="more_items">
{exp:stash:get_list name="items-{segment_2}" offset="3"}
{item_title}
{/exp:stash:get_list}
</div>
You'll notice I have a h1 that contains a link to View more. This has some JS to handle the reveal of the "more_items" div. However, i'd like to hide the View more link if there are only 3 or less items.
I have tried moving the heading inside the first list but because it is limited by 3 it can't figure out if there are more than 3 to show the link.
I would be grateful if anyone has any advice. :)