If you want to add a block into cms page, you just have to add this into its content
1 | {{block type="adin_page/page_html_combos" name="combos" template="page/html/combos.phtml"}} |
Of course, don’t forget to create the block class app/code/local/Adin/Page/Block/Page/Html/Combos.php
1 2 3 4 | class Adin_Page_Block_Page_Html_Combos extends Mage_Core_Block_Template { //... } |
and the .phtml file
app/design/frontend/adin/default/template/page/html/combos.phtml
But when you want to render the page, nothing.
On the logs (system.log), you have : Security problem: adin_page/page_html_combos has not been whitelisted.
It’s a new feature since securoty Patch SUPEE-7405 and Magento CE 1.9.2.2, you have to add your block into whitelist. You can do it manually, in backoffice, System > Permissions > Blocks or do it programmatically :
1 2 3 4 5 6 7 8 9 | $blockNames = array ( 'adin_page/page_html_combos' ); foreach ( $blockNames as $blockName ) { $whitelistBlock = Mage::getModel( 'admin/block' )->load( $blockName , 'block_name' ); $whitelistBlock ->setData( 'block_name' , $blockName ); $whitelistBlock ->setData( 'is_allowed' , 1); $whitelistBlock ->save(); } |