I need some advise on the best way to achieve this.
I have entries within a section which could belong to category A, B, C, D. Any of these entries could also belong to a Featured category.
Each category has it's own page, and from an entry you can go to the next or previous entry (within that category).
I can't see how I can do this for the Featured entries as they also belong to another category.
I'm thinking I'll have to do something with the URLs so the entry knows its been clicked on from the 'Featured' category page rather than 'B' so the Previous and Next buttons stay within 'Featured'.
This is my Next and Previous buttons code on the entry template:
{% set params = craft.entries.section('galleries').relatedTo(categories.galleries) %}
{% set nextEntry = entry.getNext(params) %}
{% set prevEntry = entry.getPrev(params) %}
<div class="previous-next-links align-right">
{% if prevEntry %}<a href="{{ prevEntry.url }}" class="cta-link prev cta-link--back">Prev</a> |{% endif %}
{% if nextEntry %}<a href="{{ nextEntry.url }}" class="cta-link next">Next</a>
{% else %}
<span class="cta-link cta-link--inactive next">Next</span>
{% endif %}
</div>