0

I want to add a static block on my website Category page. This is the link of that page.

https://flowerportal.in/online-flower-delivery/all-cities/bangalore

I have just created some banners for Bangalore product page but I don't know how to add a static block here. If you guys can help me regarding this then I will be really happy.

migrated from serverfault.com Aug 9 '18 at 13:53

This question came from our site for system and network administrators.

  • This is more of a programming question than a sysadmin question. Ideally, it'll be moved to a place where it's more likely to get good answers. You could expedite that process by clicking the "flag" option on the post and asking for a migration to Stack Overflow. – TRiG Aug 9 '18 at 13:22
  • or to Magento, if such questions are on topic there. In the current state it would be off topic on SO as well. – Gerald Schneider Aug 9 '18 at 13:39
0

You need to add the below code to your catalog/product/view.phtml according to your requirement and change the block_identifier with your identifier which includes the banners:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
0

Since the product page is built with the help of PHTML and XML files, you can call a static block from the layout XML file or directly from the phtml file.

Since you want to call the static block for the particular condition, I would recommend calling the block from the phtml file.

To do so, open the phtml file and call

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>

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.