I understand I can use a conditional to output a 'next page' link only when next pages exist, but I am finding a problem with direct URLs.
Let's say you have 20 entries and 10 per page.
The URL /news (or /news/p1) and /news/p2 should work, but I would expect /news/p3 to show no results or a message.
What I'm finding however is that /news/p3 and beyond returns the last entry in the collection.
Here's the template code:
{% paginate craft.entries.section(listingSection).order('postDate desc').limit(2) as entriesOnPage %}
<div class="ral-loading ral-hero-block ral-headline">Loading the latest content...</div>
<div class="isotope js-isotope" >
{% for entry in entriesOnPage %}
{% if entry.section.handle != 'tweet' %}
{% switch entry.tileSize %}
{% case "Single" %}
{% include '_partials/_isotope_block_single.html' %}
{% case "Double Horizontal" %}
{% include '_partials/_isotope_block_horizontal.html' %}
{% case "Double Vertical" %}
{% include '_partials/_isotope_block_vertical.html' %}
{% case "Quadruple" %}
{% include '_partials/_isotope_block_big.html' %}
{% case "Quote" %}
{% include '_partials/_isotope_block_quote.html' %}
{% endswitch %}
{% else %}
{% include '_partials/_isotope_block_tweet.html' %}
{% endif %}
{% endfor %}
</div>
{% if paginate.nextUrl %}
<div class="ral-load-more-posts nav-previous">
<div class="container">
<a class="ral-load-more-posts-text" href="{{ paginate.nextUrl }}">Load more posts</a>
</div>
</div>
{% endif %}
{% endpaginate %}
limit(2)
in the opening paginate block? It might not be doing what you think it's doing.