My original question here helped me figure out how to build my URL structure but now the site has introduced two categories: design and photo.
I want the "Prev" and "Next" buttons to navigate back and forth within the category of the current entry.
I know how to get the category of the current entry here:
{% for category in entry.category %}
{{ category.title }}
{% endfor %}
...but I don't know how to put category.title into a variable to build my params. This is my best shot at the solution but it's broken and I've given up spinning on it myself :) Any help would be much appreciated.
{% set category = "craft.categories.relatedTo(entry)" %}
{% set params = craft.entries.section('projects').order('title asc').relatedTo(category) %}
{% set prevEntry = entry.getPrev(params) %}
{% set nextEntry = entry.getNext(params) %}
{% if nextEntry %}
{% set nextEntryUrl = nextEntry.url %}
{% else %}
{% set firstEntry = craft.entries.section('projects').first() %}
{% set nextEntryUrl = firstEntry.url %}
{% endif %}
{% if prevEntry %}
{% set prevEntryUrl = prevEntry.url %}
{% else %}
{% set lastEntry = craft.entries.section('projects').last() %}
{% set prevEntryUrl = lastEntry.url %}
{% endif %}