getResources include/exclude (filter) results by value of a TV

Summary

Trying to use getResources to find and return resources with a TV set only to a specific value

Issue

Please direct me to where this may have been detailed before…I have been unable to locate a clear demonstration of how this should work.

I have resources with a TV (input type of checkbox) in order to have multiple categories associated to them via that TV. I am using getResources and attempting to use the “&tvFilter” parameter to return only the resources that meet the filter criteria. Instead, I get results of every resource within the specified parent.

My getResources call:

   [[!getResources?
   &parents=`15`
   &depth=`2`
   &limit=`15`
   &includeTVs=`1`
   &processTVs=`1`
   &includeContent=`1`
   &tvPrefix=``
   &tvFilter=`project-category==%access%`
   &tpl=`category_slide_tpl`
   ]]

My TV input options:

    Access to Resources==access||Civic and Volunteer Engagement==civic||DEAI==deai||Education and Literacy==education||Elderly and Intergenerational==elderly||Environment-Climate Change and Animals==environment||Health and Wellness==health||Hunger and Homelessness==homeless||Justice-Peace and Safety==justice

My Template Chunk:

    <div class="categorySlide">
    <div class="category_thumb"><img src="[[+link-to-thumbnail]]" alt="[[+pagetitle]]" width="500" height="280" /></div>
    <div class="project_title_bar">[[+introtext]]</div>
    </div>

I need help understanding what operation the “&tvFilter” is performing (as it doesn’t behave as I expect), and ultimately, how to get only the results of a given category. It is probable that I have a simple error in syntax, or how I setup my TV, or some other simple problem. Any help pointing out that error is welcome.

Thank you.

The property is called &tvFilters with an s at the end.
The query should work if you make this adjustment.


Also, maybe use this instead when you filter for exact values.

&tvFilters=`project-category===access`

@halftrainedharry - AH, Brilliant! That would prevent proper behavior for sure! Thank you for taking a moment to point that out. Also, thanks for the tip on filtering for exact values.

Solved.

Thanks again!