Hi,
I’m building a site whose primary channel is a bunch of real estate properties. So I have a “houses” channel. I wanted to group these by location, and first tried using categories to do, but it turned out I need to save more than just a title, desciption, and single image for each location. So I decided to dedicate a whole channel to locations, create all the fields I need, and then use a relationship field in the houses channel to assign each house to a location.
This works fine: The location template basically outputs information from that particular location and then retrieves the related houses, creating a list of links to the houses to be shown in their own template:
{exp:channel:entries channel="locations" dynamic="on" limit="1"}
{location_long_name}
{location_description}
{location_highlights}
{location_image}
<h2>Houses in {title}:</h2>
<p><ul><br />
{reverse_related_entries}<br />
<li><a href="{url_title_path='properties/house'}">{title}</li><br />
{/reverse_related_entries}<br />
</ul><br />
{/exp:channel:entries}And my house template boils down to this:
{exp:channel:entries channel="houses" dynamic="on" limit="1"}
<h1>{title}</h1>
{house_description}
{house_image}
{/exp:channel:entries}
I want to add previous and next links to this house template, but if I use the standard {exp:channel:next_entry} and {exp:channel:prev_entry} tags in the house template, they’re going to link to entries that aren’t in the same location as the current entry.
Is there some kind of {exp:query} that could output the prev/next links that share the same location as the current entry? I found a few plugins that seemed close but don’t quite address this particular challenge.
Thanks!