Filter by a channel-field
Hi Low,
I am creating events-site and i would like to filter the events by just clicking a link from a list which is channel-field. For example an event has 3 options for during an amount of time: 1 hour, half a day, whole day long.
I created for the channel-field {duur} a radio buttoned field to choose from.
I would like to output a list with the three option and when clicked "1 hour" you will find all the events that will take 1 hour.
I'm using the code below for 'filter-category' but whats the right code for filter by channel-field?
{exp:low_search:filters query="{segment_3}" result_page="main-templates/result-filter"}
{exp:channel:categories channel="item" style="linear"}
{if count == 1}<ul>{/if}
<li>
<a href="{low_search:url toggle:category="{category_id}"}">{category_name}</a>
{if category_id IN ({low_search_category})}✓{/if}
</li>
{if count == total_results}</ul>{/if}
{/exp:channel:categories}
{/exp:low_search:filters}
Replies
Low 11 Jul 2013 12:38
You can use Low Options to output the radio button options in your template. Then use code similar to this:
Dave 11 Jul 2013 13:02
Thanks for the fast reply.. (i allready read about Low Options in this site)..
I'm now able to output the list in the template but the URL isn't correct
this is the url outputed by the created link
......../index.php/main-templates/{low_search:url search:duur=
With the following message:"The URI you submitted has disallowed characters."
Don't I have to put in a result-page somewhere?
Thanks Low..
Low 11 Jul 2013 13:10
Oh, try and add parse="inward" to the Low Options tag.
Dave 11 Jul 2013 14:03
I did, but the result remaines...
this is the "source-code"
<a href="{low_search:url search:duur="=een uur"}"> een uur </a>
this is actuel code
{exp:low_options:duur parse="inward"}
<ul>
<li>
{options}
<a href="{low_search:url search:duur="={option:value}"}">
{option:label}
</a>
{/options}
</li>
</ul>
{/exp:low_options:duur}
I would realy like to see the "results" on a new result-page, where do I need to edit that in?
Low 11 Jul 2013 14:06
The code in my example is meant to be placed inside the Filters tag pair. That way it would inherit the query="" param from it.
If you're placing it outside the Filter tag pair, use
{exp:low_variables:url}
tag.Dave 11 Jul 2013 14:26
I wrapped your previous code within the Filter tag pair, and it works as i would have hoped.
Thanks Low now the code looks like this:
{exp:low_search:filters query="{segment_3}" result_page="main-templates/result-filter"}
{exp:low_options:duur parse="inward"}
<ul>
<li>
{options}
<a href="{low_search:url search:duur="={option:value}"}">
{option:label}
</a>
{/options}
</li>
</ul>
{/exp:low_options:duur}
{/exp:low_search:filters}
I'll propably have more questions about different topics later on, so speak to you soon..
Best Regards Dave
Dave 30 May 2014 13:30
Hi Low,
The results off course are shown by the Result Tag, for i'm using LS to select posts within a given date-range..
Is it possible to diplay those results by event-date order.
Could I use Low Reorder or is there a another way to order posts by event-date in this case?
Low 30 May 2014 14:07
If you just order by the field itself (orderby="my_low_events_field"), that should already produce the right results.
Dave 30 May 2014 14:49
Thanks, Low..
I meant to ask this within the quetsion thread of yesterday but ended up in here..
Thanks for helping out on all of these things.
Best regards
Dave