Where are Magento static CMS blocks stored?
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 t开发者_Python百科he 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();
They are in the db table cms_block
like clockwork geek has said, but be aware that if you add them into the db through sql (using a module install script for example) you also need to add the newly created blocks id and the store id to table cms_block_store
or the block won't appear.
精彩评论