title: How do I get the current catageory id?
body: <p>I have a CMS page that I am going to display products on with the following updated XML code:</p>
  
  <pre><code>&lt;reference name="content"&gt;
      &lt;block type="catalog/product_list"  name="product_list" template="catalog/product/wholesale-list.phtml"&gt;
          &lt;action method="setCategoryId"&gt;&lt;category_id&gt;191&lt;/category_id&gt;&lt;/action&gt;
          &lt;action method="setToolbarBlockName"&gt;&lt;name&gt;product_list_toolbar&lt;/name&gt;&lt;/action&gt;
      &lt;/block&gt;
  &lt;/reference&gt; 
  </code></pre>
  
  <p>I have tried getting the ID I set in the layout, but no such luck. I have tried:</p>
  
  <pre><code>$_category = Mage::registry(‘current_category’);
  $currentCategoryId= $_category-&gt;getId();
  </code></pre>
  
  <p>and </p>
  
  <pre><code>$layer = Mage::getSingleton(‘catalog/layer’);
  $_category = $layer-&gt;getCurrentCategory();
  $currentCategoryId= $_category-&gt;getId();
  </code></pre>
  
  <p>But neither of these methods work. Does anyone know how I can get the ID?</p>