0

I have created a static block to put on my tab content for my product details page. I have WYSIWYG editor to one of my field in my product (ex: delivery)

I have used this code below:

{{block type="cms/block" block_id="your_block_id"}}

But it doesn't work. After placing the code this what I get

enter image description here

enter image description here

Please help

Thanks!

1

By default you cannot add cms directives to the product attributes.
I mean you can, but they won't get parsed.
If you want to show them correctly you need to print the value as follows.
Let's say the attribute code is delivery.

Do this:

<?php
$value = $_product->getDelivery();
$processor = Mage::getModel((string)Mage::getConfig()->getNode(Mage_Cms_Helper_Data::XML_NODE_BLOCK_TEMPLATE_FILTER)));
$processedValue = $processor->filter($value);
?>
<?php echo $processedValue;?>
0
0

I don't think it is possible to have CMS blocks render as product attribute values. If you do want the CMS block content as the attribute value why don't you just copy the block's content into that attribute?

If you do want to use a static block you could follow something like this.

OR

You could write in code like this to get static block content:

$cmsStatic = $product->getDelivery()
echo $this->getLayout()->createBlock('cms/block')->setBlockID($cmsstatic)->tohtml();

The Value in Delivery attribute would be the block id of the CMS block.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.