I'm trying to filter a collection using multiple values that do NOT equal an item ID. First I tried this:
Code
- perch_collection('Cocktails',[
- 'template'=>'cocktails/_list_item.html',
- 'sort' => '_order',
- 'sort-order' => 'asc',
- 'filter' => [
- [
- 'filter' => '_id',
- 'match' => 'neq',
- 'value' => $featured_cocktails[0]['feat_cocktail'][0],
- ],
- [
- 'filter' => '_id',
- 'match' => 'neq',
- 'value' => $featured_cocktails[0]['visitor_ctr_cocktail'][0],
- ]
- ],
- 'match'=>'and',
- 'count'=>4,
- 'paginate'=>true,
- ]);
I then realized that I'm supposed to use match type "in" with comma separated values. The problem is I need the reverse of that output. Basically, I need the reverse of this:
Code
- perch_collection('Cocktails',[
- 'template'=>'cocktails/_list_item.html',
- 'sort' => '_order',
- 'sort-order' => 'asc',
- 'filter' => [
- [
- 'filter' => '_id',
- 'match' => 'in',
- 'value' => $featured_cocktails[0]['feat_cocktail'][0].','.$featured_cocktails[0]['visitor_ctr_cocktail'][0],
- ],
- ],
- 'match'=>'and',
- 'count'=>4,
- 'paginate'=>true,
- ]);
Do I need to use a callback function? If so, will it work with paging, and how can I bring the IDs into the function?