title: Make Magento 1.9 product filter collapsible
body: <p>I'm trying to make the product filter for a magento shop collapsible. I tried editing the view.phtml in template/category/layer/view.phtml But it's not working.</p>
  
  <p>I Edited these lines:  <code>&lt;dt&gt;&lt;?php echo $this-&gt;__($_filter-&gt;getName()) ?&gt;&lt;/dt&gt;</code></p>
  
  <p>to <code>&lt;dt&gt;&lt;a href="/"&gt;&lt;?php echo $this-&gt;__($_filter-&gt;getName()) ?&gt;&lt;/a&gt;&lt;/dt&gt;</code></p>
  
  <p>and i added some jquery like this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      /* &lt;![CDATA[ */
      jQuery(document).ready(function(){
          jQuery("dl#narrow-by-list&gt; dd:not(:first)").hide();
          jQuery("dl#narrow-by-list&gt; dt a").click(function(){
              jQuery("dl#narrow-by-list&gt; dd:visible").slideUp("fast");
              jQuery(this).parent().next().slideDown("fast");
              return false;
          });
      });
      /* ]]&gt; */
  &lt;/script&gt; 
  </code></pre>
  
  <p>Current code:</p>
  
  <pre><code>?&gt;
  &lt;?php  if($this-&gt;canShowBlock()): ?&gt;
  &lt;div class="block block-layered-nav"&gt;
      &lt;div class="block-title"&gt;
          &lt;strong&gt;&lt;span&gt;&lt;?php  echo $this-&gt;__('Shop By')  ?&gt;&lt;/span&gt;&lt;/strong&gt;
      &lt;/div&gt;
      &lt;div class="block-content"&gt;
          &lt;?php  echo $this-&gt;getStateHtml()  ?&gt;
          &lt;?php  if ($this-&gt;getLayer()-&gt;getState()-&gt;getFilters()): ?&gt;
              &lt;div class="actions"&gt;&lt;a href="&lt;?php  echo $this-&gt;getClearUrl()  ?&gt;"&gt;&lt;?php  echo $this-&gt;__('Clear All')  ?&gt;&lt;/a&gt;&lt;/div&gt;
          &lt;?php  endif; ?&gt;
          &lt;?php  if($this-&gt;canShowOptions()): ?&gt;
              &lt;p class="block-subtitle"&gt;&lt;?php  echo $this-&gt;__('Shopping Options')  ?&gt;&lt;/p&gt;
              &lt;dl id="narrow-by-list"&gt;
                  &lt;?php  $_filters = $this-&gt;getFilters()  ?&gt;
                  &lt;?php  foreach ($_filters as $_filter): ?&gt;
                  &lt;?php  if($_filter-&gt;getItemsCount()): ?&gt;
                      &lt;div class="&lt;?php  if(strcasecmp($_filter-&gt;getName(), 'PRICE') == 0) echo 'layered-price'; else echo 'layered-attribute'; ?&gt;"&gt;
                          &lt;div class="title-layered"&gt;&lt;dt&gt;&lt;a href="/"&gt;&lt;?php  echo $this-&gt;__($_filter-&gt;getName())  ?&gt;&lt;/a&gt;&lt;/dt&gt;&lt;/div&gt;
                          &lt;dd&gt;&lt;?php  echo $_filter-&gt;getHtml()  ?&gt;&lt;/dd&gt;
                      &lt;/div&gt;
                  &lt;?php  endif; ?&gt;
                  &lt;?php  endforeach; ?&gt;
              &lt;/dl&gt;
              &lt;script type="text/javascript"&gt;decorateDataList('narrow-by-list')&lt;/script&gt;
          &lt;?php  endif; ?&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;?php  endif; ?&gt;
  &lt;script type="text/javascript"&gt;
      /* &lt;![CDATA[ */
      jQuery(document).ready(function(){
          jQuery("#narrow-by-list&gt; dd:not(:first)").hide();
          jQuery("#narrow-by-list&gt; dt a").click(function(){
              jQuery("#narrow-by-list&gt; dd:visible").slideUp("fast");
              jQuery(this).parent().next().slideDown("fast");
              return false;
          });
      });
      /* ]]&gt; */
  &lt;/script&gt;
  </code></pre>
  
  <p>Anyone any idea why this is not working?</p>