Magento Layered Nav PHP - Remove the filter in URL
===

I'm manipulating the inbuilt Layered Navigation filters to use checkboxes in place of the 'currently shopping' section that appears when using a filter. I have successfully set up the checkbox system to add a filter using this:

    <input type="checkbox" id="filter-checkbox-<?php echo $_item->getLabel() ?>" class="filter-checkbox" onclick="setLocation('<?php echo $this->urlEscape($_item->getUrl()) ?>');"/> 
       
     <a href="<?php echo $this->urlEscape($_item->getUrl()) ?>" class="m-notselected-ln-item" title="<?php echo $_item->getLabel() ?>">
        
    <?php echo $_item->getLabel() ?>
    
    </a>


That's works fine to add the filter to a non-checked item (within an else statement). And I end up with a URL like this:

    category/category.html?filtered_attribute=97&filtered_attribute=105


I'm just having trouble with the php to use for the onclick when unchecking the box. i.e. to remove which ever `filtered_attribute=xx` from the URL.

Looking at the standard template files - the remove filter button uses:

    <?php echo $_filter->getRemoveUrl() ?>

But that breaks the page and results in the rest of the layered nav to not load.

(I know it's still messy and I will clean up the double urls for checkbox / anchor tag etc and convert to SEO URLs once it's all working)