I cannot the location of static CMS blocks in the database. Where are they?
The reason I need to know this is that when I move the database and my theme files from my local install to my online dev-install, the block does not update, and I need to re-create them for each installation.
Follow-up question would be, how do I create them programmatically?
EDIT: If anyone finds the question unclear I know how to make a static block in the Magento backend. The question is where are they stored in the Magento db/filesystem?
Blocks are stored in the database table cms_block
. But you don't need to know that if you are going to create them programmatically.
$newBlock = Mage::getModel('cms/block')
->setTitle('This is the title')
->setContent('This is the content')
->setIdentifier('an-identifier')
->setIsActive(true)
->setStores(array(1)) // see Sergy's comment
->save();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With