I've created 2 static blocks for 2 different languages. Both of them have the same identifier:

  • identifier: privacy-policy (name: Privacy Policy EN)
  • identifier: privacy-policy (name: Privacy Policy DE)

Now I want to change their content programatically for each one. One in english and one in german language.

I know that I can use this piece of code to change the content for a static block without multilingual:

$identifier = 'privacy-policy';
$block = Mage::getModel('cms/block');

if ( ! $block->load($identifier)->getIdentifier()) {
    $content = 'My content here';
    $block->setTitle('Privacy Policy');

But when I load the block by identifier every time it will return the same block, the first block that is founded in cms_block table.

Is there a way to change the content by each block with the same identifier? And I don't want to load it by name, because that is just wrong. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.