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 attributset_name}}/configuration/test/product_id/{{var product_id}}"> konfigurieren </a> |
We want to send attributset_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['attributset_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
You want or need help implementing this solution? Maybe you did not find what you were looking for? Contact me and I will assist you with whatever Magento problem troubles you!