I've managed to sort the last li issue, but can't seem to now link my last list item back to the latest entry in the specific category. Any ideas?
{exp:channel:entries channel="project" limit="6" category_group="1" stop_before="{embed:stop_before}" related_categories_mode="yes" custom_fields="yes"}
{if count == "1"}<ul id="filmStrip">{/if}
<li>
{exp:imgsizer:size src="{project_image}" height="68px" width="137px"}
<a href="{title_permalink='projects-test/view'}"><img src="{sized}" height="{height}" width="{width}" alt=""/></a>
{/exp:imgsizer:size}
<a href="{title_permalink='projects-test/view'}"><p class="thumbTitle">{title}</p></a>
</li>
{if total_results <= '5' AND total_results == count}
<li>
<a href="{path='projects-test/view'}/{first_entry_id}"><img src="../../../images/backtostart.jpg" height="68px" width="137px" alt=""/></a>
<a href="{path='projects-test/view'}/{first_entry_id}"><p class="thumbTitle">Back to start</p></a>
</li>
{/if}
{if count == total_results}</ul>{/if}
{/exp:channel:entries}
One issue is that you're using the
{count}
and{total_results}
variables outside of the channel:entries loop, which won't work.Here's how you can limit the display of the "back" link in this manner, and also link to the first entry in that category (by "first" I assume you mean "newest"):
I haven't tested this, so let me know if it throws a fit.
UPDATE: Things to try to get the "first entry" query to work:
parse="inward"
to the exp:query tag.The nested
{if}
statement I used above should work - and it's better to use that than the advanced one you updated your original post with, as it will cause the query statement to run every time.