You have to use so called filters to send parameters to a static block from a template for example. Lets take a look at the following code:
Thats the static Magento block:
|
1 2 3 |
<a href="{{store url=''}}{{var attribute_set_name}}/configuration/test/product_id/{{var product_id}}"> Configure </a> |
We want to send attribute_set_name and product_id dynamically to the block. Add the following code to a template for example:
|
1 2 3 4 5 6 7 8 9 10 |
$block = $this->getLayout()->createBlock('cms/block')->setBlockId('block_name'); $variables = array(); $variables['product_id'] = 123; $variables['attribute_set_name'] = 'whatever'; $filter = Mage::getModel('core/email_template_filter'); $filter->setVariables($variables); // This will now echo the blocks HTML with the values from the passed parameters. echo $filter->filter($block->toHtml()); |
Sending parameters to a static block
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.