I’m trying to translate this snippet call to a runSnippet call but I’m having problems with the tvFilters parameter. Here is the regular call which works just fine:
[[getResources? &parents=`38` &tvFilters = 'MediaInfo==Featured' &tpl='listCategoryLinksInner']]
Here is the runSnippet call that I can’t get to work (works fine without the tvFilter option. Also, contains a couple extra parameters not listed above):
$categoryItems = $modx->runSnippet (
"getResources" , array(
"tpl" => "listCategoryLinksInner",
"parents"=>"38",
"offset"=>"$start",
"limit"=>"3",
"depth"=>"1",
"sortby"=>"pagetitle",
"sortdir"=>"ASC"
,"tvFilters" => "MediaInfo==Featured"
)
);
Any ideas on how to pass the tvFilters parameter with a runSnippet call?
UPDATE
It was my query that was bad rather than the syntax. I had template variables with multiple checkbox options ("Featured" and "Categories"). The initial line of code:
"tvFilters"=>"MediaInfo==Featured"
wasn’t returning any results because both boxes were checked in the resources that the TV’s were tied to. The correct query that is now working is this:
"tvFilters"=>"MediaInfo==%Featured%"
I could have sworn I had gotten could results with the normal snippet call previously using "&MediaInfo==Categories" but I guess I must have had some other Snippet returning those results.
-matt