Use the below code to add a Magento block to your CMS page.
1 |
{{block type="cms/block" block_id="block_id"}} |
Use the below code to add a Magento block to your CMS page.
1 |
{{block type="cms/block" block_id="block_id"}} |
To remove a certain block from the Magento cache, use the below code.
1 2 3 |
<reference name="name.of.the.block"> <action method="setCacheLifetime"><s>null</s></action> </reference> |
The below code shows how to echo the HTML of a block with the id ‘my_block’.
1 |
echo $this->getLayout()->createBlock('cms/block')->setBlockId('my_block')->toHtml(); |
Using the folowing layout update, you can add a static block to the left sidebar:
1 2 3 4 5 6 |
<!-- left --> <reference name="left"> <block type="cms/block" name="STATIC_BLOCK_NAME"> <action method="setBlockId"><block_id>STATIC_BLOCK_ID</block_id></action> </block> </reference> |
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…
The following 4 examples show how to get the skin, media, base and store URLs in a MAgento block or CMS page: skin: {{skin url=’images/sampleimage.jpg’}} media: {{media url=’/sampleimage.jpg’}} base: {{base url=’yourstore/mypage.html’}} store: {{store url=’mypage.html’}}