Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to include cms block in template file(.phtml)?

Answer Posted / Prashant Sagar

To include a CMS block in a template file (.phtml), follow these steps:

1. Navigate to Content > Blocks in the Magento admin panel and create a new static block or edit an existing one.
2. In the Identifier field, enter a unique identifier for the block (e.g., header_banner).
3. Fill out the other required fields as needed and save the block.
4. In your template file (.phtml), use the following code to include the CMS block:

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

5. Replace 'header_banner' with your CMS block identifier.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is the latest version of magento?

2