Hi all, this is a complicated one…
In a site I’m working on “events” entered into the events weblog are related to “venues” which have been added to a separate venues weblog. Many events may be related to a single venue entry. I’m using 1.6.9.
Now… I’m using dynamic parameters to help refine a listing of events weblog entries by their “venue”. Unfortunately, at the moment, it’s only returning one event when, in some cases, a particular venue may have up to ten.
Here’s how I’m doing it:
The form that sets the dynamic parameter:
<select name="search:venue_test" id="search:venue_test">
<option value="">Select Venue</option>
{exp:weblog:entries weblog="venues"}
{reverse_related_entries limit="1"}
{if no_reverse_related_entries}<!-- comment out the venue name if it's got no related entries{/if}
<option value="{venue_test}">{/reverse_related_entries}
{venue_name}
{reverse_related_entries limit="1"}{if no_reverse_related_entries}finish commenting out the venue name -->{/if}</option>
{/reverse_related_entries}{/exp:weblog:entries}
</select>The value returned by “{venue_test}” is a number - this field is a Relationship field. This number is passed as a dynamic parameter to the results page which displays results using this code:
{exp:weblog:entries weblog="festival-2010-events" orderby="date" sort="desc" dynamic_parameters="search:event_title|search:event_days|search:venue_test"}Like I said, the system is working (even if it’s a bit of a hack) but it’s only returning one result per venue. Is the relationship number unique to a relationship, or unique to a venue? Worded differently… is that number only valid for one relationship with the venue concerned? If so, can anyone suggest a means by which it might be possible to search weblog entries by their related articles.
Thanks,
John.