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

Support archive

Excluding categories doesn't appear to be working

ibrychgo 13 Nov 2013 20:53 problem, rejected

Using a category parameter that excludes a category doesn't appear to be working.

Example: We have a number of team members. Some are assigned to the "Executive" category (ID# 18). The rest have no category assigned.

Creating the executive list with a parameter of 'category="18"' works just fine. It only lists the executive team.

But the regular employees list, executed with a parameter of 'category="not 18"' spits out a list of ALL of the members, INCLUDING those in category #18.

Our workaround was simply to add a new category called "Team Member", assign all of the non-executive employees to that, and voila, we can spit them out by themselves.

But still, I think it would be great if we could exclude categories with LOW Re-order.

We are using Zoo Triggers. I've never noticed a conflict with that before but it might be the culprit.

This isn't urgent since we have a workaround. More of an FYI.

Replies

  1. Low 13 Nov 2013 21:01

    Can you make a screenshot of the reorder Set's settings? Also, can you enter the template code you're using? You can use http://pastie.org/ or http://pastebin.com/ for large chunks of code.

  2. Bryan Lewis 13 Nov 2013 21:44

    Sure! Thanks for the fast reply!

    The settings:


    The template code:

     
    {exp:low_reorder:entries
    set="1"
    channel="team"
    disable="category_fields|member_data|trackbacks"
    sort="asc"
    orderby="cf-people-last_name"
    status="open|public"
    dynamic="no"
    limit="100"
    category="not 18"
    {triggers:entries}
    }

    <div class="large-2 small-6 columns {if count==total_results}end{/if}">
    <div class="teamcard">
    <img src="{cf-people-photo:thumbnail}" alt="{cf-people-first_name} {cf-people-last_name}" title="{cf-people-first_name} {cf-people-last_name}">
    <p class="caption"><a href="{cf-people-vcard}">{cf-people-first_name} {cf-people-last_name}</a><br><strong>{cf-people-title}</strong></p>
    </div>
    </div>
    {/exp:low_reorder:entries}

  3. Bryan Lewis 13 Nov 2013 21:45

    sorry for the wonky formatting. My first time pasting code on a forum and my tabs all went wonky in the process. :P

  4. Low 13 Nov 2013 21:52

    What does the {triggers:entries} variable equate to? Turn on template debugging, and look up the fully parsed opening exp:low_reorder:entries tag there. What does that say?

  5. Bryan Lewis 13 Nov 2013 22:07

    The zoo:triggers module uses url segments to dynamically add the right parameters to yield category and date-based archives.

    I have tried it without zoo:triggers. But it didnt change at all. However, you asking me to look at the debug for this tag helped me understand exactly what it is doing and why it is supposed to be the last parameter. :)

    Here's the entries tag from template debugging when NOT filtering anything.
    (i.e. the url is simply "/team" so zoo:triggers doesn't get triggered):

     
    {exp:low_reorder:entries set="1" channel="team" disable="member_data|trackbacks" sort="asc" orderby="cf-people-last_name" status="open|public" dynamic="no" limit="100" category="not 18" }



    Of course, that yields everyone including those in category 18.

    And here it is on /team/location/chicago (where zoo:triggers should add a category parameter for the chicago category.)

     {exp:low_reorder:entries set="1" channel="team" disable="member_data|trackbacks" sort="asc" orderby="cf-people-last_name" status="open|public" dynamic="no" limit="100" category="not 18" category="6" }


    The results do get filtered to the "chicago" category, but the results still include category 18.

  6. Low 13 Nov 2013 22:26

    First off all, if you're defining a set="", you don't need to add the channel, sort, orderby, limit or status parameters. The Set's parameters will be set automatically. Only set the params if you need to overwrite the Set's params.

    Secondly, having the same param twice in a tag, which you have using the Zoo Triggers var, will only apply the last param. The first one will simply be overwritten.

    If you're saying the first example doesn't filter out category 18, then first check out this note in the native docs:

    If you are using exclusion (category="not 3|4") and an entry is in a category that is not excluded, the entry will be returned even if it also belongs to an excluded category.


    You can try and change the low_reorder:entries tag with the regular channel:entries tag to see if the same behaviour occurs. If it does, it's not a LR issue. If it does not, it might be.

    The second example will only apply category="6" to the entries, as explained above.

  7. Bryan Lewis 19 Nov 2013 01:59

    Ahhhhh! I get it now. Sorry and thank you!