Low search toggle on range
Hi Low,
I’ve been trying to get the toggle feature of a filter tag working for a date range
I have successfully set-up toggles for the keyword and categories, however, the date range is proving elusive.
If you visit the following URL you can see that the toggle link for the date (under the main Search results title) contains the date URL parameter twice:
http://tt.thoughtfulweb.co.uk/search?...
I guess this is why the toggle is not working, but I can not establish why the date is being repeated.
Here’s the code I’m using the generate the link
{exp:low_search:filters query="{segment_1}"}
on
<a href="{low_search:url toggle:range:entry_date="{low_search_range:entry_date}"}">
{exp:low_events:this_date date="{low_search_range:entry_date}" day_format="%l %j %F %Y"}
<i class="icon icon--close icon--red" aria-hidden="true"></i>
</a>
{/exp:low_search:filters}
I’ve tried a number of variations. Even hard-coding the date range from the URL parameter seems to end up with duplicated dates.
Any ideas?
Thanks,
Simon
PS. Latest version of Low Search and EE being used.
Replies
Low 23 Mar 2015 18:06
The toggle:-param is currently targeted to multivalued parameters, like category (eg 1|2|3), where you can add/remove single values from that parameter.
That means the range:entry_date parameter will actually be treated as 2 separate values, where LS will try to add/remove a single value.
If you're only after removing the param, you can try this inside the Filters tag:
thoughtful_web 24 Mar 2015 09:06
Hi Low,
That worked a treat – thank you!
Simon