In Magento, We have option to add the static block with static content and also We can insert the image in static block. In future, we can change that image without editing the code in file.
Here is the method to create Static block.
Step:1
Select the static blocks from cms in the back end.
Step:2
Select Add New Block.
Step:3
Give the block Title Identifier name.
Click the show /hide editor in content and insert the image then Save block.
To view the static block in front end give the following code in the header.phtml file or any newly createing file.
getLayout()->createBlock(’cms/block’)->setBlockId(’block_banner’)->toHtml(); ?>
Then we can view the static banner in the front end.
