Using Low Events with Seg2Cat?
Trying to build a simple event filtering system with categories (Seg2Cat) and dates. This is my current approach (which does not work):
{exp:low_events:entries channel="events_submitted|events_internal" category="{last_segment_category_id}" date="{last_segment}" dynamic="no" parse="inward"}
Is it possible for them to play together? Or should I rethink the approach? Perhaps use Low Search?
Replies
Dan Johnson 31 Jan 2014 19:47
I did manually place a date in the parameter which also did not work. Ideally, I'd like to be able to achieve these results with just the one tag:
http://URL.dev/events/category/arts/2...
http://URL.dev/events/category/arts
http://URL.dev/events/2014-06/
Low 1 Feb 2014 08:44
For the first URL, you won't get a valid category ID, as {last_segment_category_id} points to the last segment: the date. You'd need to get creative with simple conditionals and preload replace vars. Something like this:
Note that this approach only works when using simple conditionals for the preload replace vars.
Dan Johnson 3 Feb 2014 16:28
Thanks Low. The issue I am running into right now is that I cannot access {last_segment} with seg2cat. The output for that variable for anything with "category" (seg2cat trigger) http://URL.dev/events/category/arts is "events". Do you imagine there is a way to get this variable?
Low 3 Feb 2014 17:10
I'm not sure what you mean by "cannot access {last_segment} with seg2cat". That's not a var made available by my add-on, but a native one. If it points to a different segment, some other add-on might be in play, like Structure. Can you elaborate?
Dan Johnson 3 Feb 2014 17:45
It indeed was a Structure issue. All is well! Thanks for your input!