title: Magento - Pass a variable/parameter to Static Block
body: <p>I am working on Magento CE 1.6.2 and would like to display 'New' Products from a specific category. To do this I have created a Static block like this and passed the category I want it from.</p>
  
  <pre><code> {{block type="catalog/product_new" category_id="20" template="catalog/product/new.phtml"}} 
  </code></pre>
  
  <p>But the category Id needs to be passed dynamically from my code in one of the .phtml files. Is there a way to create a variable that I can use in this static block. Like my .phtml code is:</p>
  
  <pre><code> $_categoryId = $this-&gt;getCurrentCategory()-&gt;getId(); //Store my category id
  </code></pre>
  
  <p>Can some thing be done so that I can pass this variable to my Static Block like this, </p>
  
  <pre><code> {{block type="catalog/product_new" category_id="var $_categoryId" template="catalog/product/new.phtml"}} //Which is nothing but 20 so that it displays new products from only category 20
  </code></pre>
  
  <p>Please help !</p>
  
  <p>EDIT: I found a link which does something similar. I tied following it but to no success.
  <a href="http://magentophp.blogspot.co.uk/2011/08/passing-paramters-to-magento-cms-static.html" rel="nofollow">http://magentophp.blogspot.co.uk/2011/08/passing-paramters-to-magento-cms-static.html</a></p>
  
  <p>Can any one help me follow the link and get it to working ?</p>