Re: [Perchpole] Bucking the Query Filter!
Hi Perch,
Sorry for the delay. Anytime you start working multiple multiple sections it can get a bit tricky and start to require some custom code. I'll try to point you in the right direction.
There's two steps:
First, getting a list of category numbers that you want to select itemRecords from. Here's some sample code for that:
// get category nums of selected branch, eg: 0,3,4,6,7
$selectedCategoryNum = $_REQUEST['category'];
$selectedBranchNums = '0';
foreach ($categoryRecords as $category) {
if ($category['_isSelected'] || $category['_isAncestorSelected']) {
$selectedBranchNums .= ',' . (int) $category['num'];
}
}
Next, passing that to your item list viewer so it only returns items from those categories:
...
'allowSearch' => false,
'where' => " category IN ($selectedBranchNums) ",
And basically you should end up with a WHERE like this: category IN (0,3,4,5,6) that only shows items in those categories.
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com