Last active
August 29, 2015 14:16
-
-
Save herveguetin/61515cb5c712c5c96fed to your computer and use it in GitHub Desktop.
Create a CMS block programmatically in Magento
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$content = <<<EOD | |
Block Content line 1 | |
Block Content line 2 | |
EOD; | |
$cmsBlock = Mage::getModel('cms/block')->addData( | |
array( | |
'title' => 'Block Title', | |
'identifier' => 'block_identifier', | |
'stores' => array(0), // Available in all stores | |
'is_active' => '1', | |
'content' => $content, | |
) | |
); | |
$cmsBlock->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment