I'm working on a site which has a series of tours, some of which are related (using playa) for when a tour is available on alternateive dates.
The problem I have is I want to display a list of all the tours, but instead of showing the title, link and date for all of them. If a tour has an alternative date/relationship it displays the title once with the alternative dates listed underneath. So it outputs like this:
Tour title 1
- Date a (links to Tour title 1 page)
Tour title 2
- Date b (links to Tour title 2 page)
- Date c (links to Tour title 3 page)
- Date d (links to Tour title 4 page)
Tour title 5
- Date e (links to Tour title 5 page)
- Date f (links to Tour title 6 page)
Tour title 7 (links to Tour title 7 page)
- Date g (links to Tour title 8 page)
If any one could offer any advice I'd appreciate it. Thanks.
To give a bit more information about the configuration of the channels:
I have a channel for each Tour entry called 'tour', that has all the information about the tour, including date, price etc. There are some tours which might run several times a year, but may have different costs, flights etc, (which is why each has to be an entry in it's own right.) Within the 'tour' channel I have a Playa field {alternative_tour_dates} which lists all the tours. This would be used to 'link' the tours with alternative dates to each other.
This is my template which I want to show all the tours, but with the tours that have multiple dates, rather than displaying each one, it displays the tour that has the earliest date and lists the alternative dates, cost and url of the others.
{exp:channel:entries channel='tour' disable="category_fields|member_data" show_future_entries="yes" orderby="tour_date_start" sort="asc" search:tour_type="tour"}
<div class="unit3">
<div class="unit1 unitpadding grey overview">
<a href="{url_title_path='tours/'}"><h3>{tour_name}</h3></a>
<h4>Tour Director: {tour_to_tour_personnel}<a href="{site_url}tour-directors/{url_title}">{tour_director_name_first} {tour_director_name_last}<br /></a>{/tour_to_tour_personnel}</h4>
<ul>
<li><a href="{site_url}tours/{url_title}">{tour_date_start format="%j %F"} – {tour_date_end format="%j %F %Y"}</a> <span class="price">£{tour_base_price}</span></li>
<li>{alternative_tour_dates}<a href="{site_url}tours/{url_title}">{tour_date_start format="%j %F"} – {tour_date_end format="%j %F %Y"}</a> <span class="price">£{tour_base_price}</span>{/alternative_tour_dates}</li>
</ul>
</div>
</div>
{/exp:channel:entries}
Once again thanks for input so far.