Adding cms block to footer links magento -
how can add cms static block footer footer links , view on specific store view ? using magento 1.9
creating static block:
- go magento admin panel , select cms -> static blocks
- then click on “add new block” button right top
- now fill following fields: block title: give name of static block here. not show on frontend identifier: give id of block. used reference of block, when adding template file or cms page status: define visibility of static block on frontend content: content of static block can plain text, html code , javascript.
- click on “save block” button.
showing static block in frontend @ footer:
go app > design > frontend > your_package > your_theme > layout. open appropriate file, lets page.xml , add following code inside <block type="page/html_footer name="footer" as="footer" template="page/html/footer.phtml"">
block:
<block type="cms/block" name="your_block_id" before="-"> <action method="setblockid"><block_id>your_block_id</block_id></action> </block>
now, refresh cache @ backend , front page see cms static block @ footer.
to include block in specific store view:
<?php $store = mage::app()->getstore()->getcode(); if($store == "your-storeview"){ echo $this->getlayout()->createblock('cms/block')->setblockid('your_block_id')->tohtml(); } else { echo $this->getlayout()->createblock('cms/block')->setblockid('your_block_id')->tohtml(); } ?>
Comments
Post a Comment