I have blocks of subpages that are filtered by category I am then on top of that trying to further filter by subject type when subject type link is clicked
How can I filter my subpages by both these parameters?
Nav:
<?php $projects = $page->children()->listed(); ?>
<?php $tags = $projects->pluck('subject', ',', true); ?>
<?php foreach($tags as $tag): ?>
<a href="/page/subject::<?= $tag ?>">
<?= $tag ?>
</a>
<?php endforeach ?>
Subpages:
<?php $filterColours = $page->children()->listed(); ?>
<?php $coloursArray = $filterColours->pluck('colours'); ?>
<?php $colours = array_unique($coloursArray)?>
<?php if( param('subject') == ''): ?>
<?php foreach ($colours as $colour):?>
<div class="colour-wrapper">
<?php foreach ($page->children()->listed()->filterBy('colours', $colour, ',') as $subpage): ?>
// Subpages filtered into colour blocks
<?php endforeach ?>
</div>
<?php endforeach ?>
<?php else:?>
<?php if ($tag = urldecode(param('subject'))); ?>
<?php foreach ($colours as $colour):?>
<div class="colour-wrapper">
<?php foreach ($page->children()->listed()->filterBy('colours', $colour, 'subject', $tag, ',') as $subpage): ?>
// Subpages filtered into colour blocks further filtered by subject type
<?php endforeach ?>
</div>
<?php endforeach ?>
<?php endif ?>
