I searched the web and could not find how to do this.
I want to add a static block that I have created in admin before to a cms-page. This works using either of this lines:
{{block type="cms/block" block_id="my_block_id"}}
{{block type="cms/block" block_id="my_block_id" template="cms/content.phtml"}}
Now I want to use a custom template, i.e.:
{{block type="cms/block" block_id="my_block_id" template="modulename/custom-template.phtml"}}
When I put it into the cms-page like this, the block is shown, but the "template"-tag is completely ignored - cms/content.phtml
is used.
WHAT I TRIED
I tried to extend class Mage_Block_Cms_Block and add setTemplate($this->getTemplate());
to _toHtml()
-function. The effect is the same as above - cms/content.phtml
is used.
I tried to extend class Mage_Core_Block_Template; of course I can set a template here, but I have problems getting the static block. I can't find how to get the block by block-id.
WHAT THIS QUESTION IS ABOUT / NOT ABOUT
I know how to do this with PHP.
I know how to do this with XML-files.
It s crucial to this question that the blocks can be managed in the backend.
I run Magento CE 1.7.0.0.
Thank you for your time!