Skip to content

Instantly share code, notes, and snippets.

@roman204
Created July 18, 2014 08:26
Show Gist options
  • Save roman204/6afd9c667112a62f021d to your computer and use it in GitHub Desktop.
Save roman204/6afd9c667112a62f021d to your computer and use it in GitHub Desktop.
create cms/block in installscript
<?php
/**
* Created by PhpStorm.
* User: rhutterer
* Date: 18.07.14
* Time: 09:21
*/
$installer = $this;
//installer for footer cms-blocks
$storeView = Mage::getModel('core/store')->load('direct_de', 'code');
for($x = 1; $x <= 3; $x++) {
Mage::getModel('cms/block')
->setIdentifier('footer_links_' . $x)
->setStores(array($storeView->getId()))
->setIsActive(true)
->setTitle('footer.links.' . $x)
->setContent('<p>footer.links.' . $x . '</p>')
->save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment