All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Using Low Events with Seg2Cat?

Dan Johnson 31 Jan 2014 19:44 question, complete

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

  1. 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/

  2. 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:

    {if segment_4 != ''} 
    {preload_replace:pre_category="{segment_3_category_id}"}
    {/if}

    {preload_replace:pre_category="{last_segment_category_id}"}

    {exp:low_events:entries
    category="{pre_category}"
    date="{last_segment}"
    ...
    }


    Note that this approach only works when using simple conditionals for the preload replace vars.

  3. 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?

    Dan Johnson 3 Feb 2014 16:33

    Aside: Using seg2cat 2.8

  4. 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?

  5. Dan Johnson 3 Feb 2014 17:45

    It indeed was a Structure issue. All is well! Thanks for your input!