I'm trying to display a list of links dynamically based on the current entry that is being displayed. with code along the lines of this:
{exp:channel:entries channel='tour' disable="category_fields|member_data|pagination" dynamic="no" show_expired="no"}
{if tour_name=="tour_name"}
<h4 class="sub"><a href="{site_url}tours/{url_title}">{tour_date_start format="%j %F"} – {tour_date_end format="%j %F %Y"}</a></h4>
{/if}
{/exp:channel:entries}
I know that the code above won't work, but thought it illustrated what I was trying to achieve. Basically I have a series of tours and some of them have the same name. I want to display links to these ones with the same name, when viewing one of those tours. I know this would be best to use either categories or a playa field, but aren't able to go this route because some of the data is pulled in from an external database. I tried to use stash to set the current tour_name and then get it within the if conditional, but this wouldn't work either.
I wonder if it would be possible using the query module? Or another plugin? Maybe it's not possible at all?
If anyone can offer any help, I'd appreciate it. Thanks.