I’m sure I’m almost there. I’m also sure there has got to be a post somewhere in the forums where this is answered. However, I gave myself 3 days to search and figure this one out before posting and I still am not there.
Requirements / What I’m tring to do:
1) user comes to this single entry page and category is in URL OR maybe there is no category specified
2) user clicks prev or next buttons and sees the next single entry in the current category (if specified) if not… it cycles all entries in all categories.
3) user clicks Back to List and they are sent back to the listview template and the category is also passed.
What I’ve tried:
1) Using {if category_request}/{segment_4}{/if} to append to next and previous buttons.
Issue: Is this really needed?
2) Filtering {exp:channel:prev_entry} & {exp:channel:next_entry} by category based on the {exp:channel:category_heading channel='projects'}{category_id}{/exp:channel:category_heading}
Issue: placing all that in the category param of the next and prev tags seems rather excessive and does not seem to work. Wrapping the whole pagination in the heading tag and only putting the {category_id} in the next prev tags does seem to work but then IF no category is specified then my requirement #2 is not possible as the prev and next are hidden.
Example URL to this template: http://domain.com/index.php/projects/details/56/C6
{exp:channel:entries channel="projects" order_by="date" sort="asc" dynamic="yes"}
<div class="category_header">
<h3>{title}</h3>
<p> </p><h4>{category_name}</h4>
<p></div><br />
<ul class="prevnext_nav"><br />
<li>{exp:channel:prev_entry channel="projects" category="{exp:channel:category_heading channel='projects'}{category_id}{/exp:channel:category_heading}"}<a href="http://{id_path=%27projects/details%27}{if">/images/back.gif</a>{/exp:channel:prev_entry}</li><br />
<li><a href="http://{path=%27projects{if">/images/BackToThumbs.gif</a></li><br />
<li>{exp:channel:next_entry channel="projects" category="{exp:channel:category_heading channel='projects'}{category_id}{/exp:channel:category_heading}"}<a href="http://{id_path=%27projects/details%27}{if">/images/forward.gif</a>{/exp:channel:next_entry}</li> <br />
</ul></p>
<p><div class="project_item"><br />
<div class="image_area"><br />
{exp:channel_images:images entry_id="{entry_id}"}<br />
{image:url:medium}<br />
{/exp:channel_images:images}<br />
</div><br />
ID:AM{category_url_title}{entry_id}<br />
Description:{project_body}<br />
</div><br />
{/exp:channel:entries}