Way to getNext() within the same category I'm trying to get the next and previous entries in a structure but I only want the next or previous ones within the same category?

Is it possible to do something like this?

{% set next = entry.getNext().relatedTo(category).first() %}
You're close! getNext and getPrev take an ElementCriteriaModel as a parameter:

{% set params = craft.entries.section('news').relatedTo(category) %}

{% set prevEntry = entry.getPrev(params) %}
{% set nextEntry = entry.getNext(params) %}

{% if prevEntry %}&lt;a href="{{ prevEntry.url }}"&gt;Previous&lt;/a&gt;{% endif %}
{% if nextEntry %}&lt;a href="{{ nextEntry.url }}"&gt;Next&lt;/a&gt;{% endif %}


Or, if you prefer, a params array (same as you would pass to craft.entries ElementCriteriaModel):

{% set params = {
    section: 'news',
    relatedTo: category,
} %}