Is it possible to collapse all filters on layered navigaton and if so how?
Currently half of our filters are collapsed and some are open such as colour and category by default
How do we collapse and open filter programatically?
go in the file
/app/design/frontend/{yourpackage}/{yourtheme}/template/catalog/layer/view.phtml
add anchor an element DT
<dt><a href="/"><?php echo $_filter->getName() ?></a></dt>
paste add the following code in the bottom of view.phtml
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready(function(){
jQuery("dl#narrow-by-list> dd:not(:first)").hide();
jQuery("dl#narrow-by-list> dt a").click(function(){
jQuery("dl#narrow-by-list> dd:visible").slideUp("fast");
jQuery(this).parent().next().slideDown("fast");
return false;
});
});
/* ]]> */
</script>
Remove class "open" from line no.41
<div class="block-content toggle-content open">
yourpackage/theme/template/catalog/navigation/left.phtml.
........... ...........