cancel
Showing results for 
Search instead for 
Did you mean: 

static blocks

static blocks

how can i Add static blocks to navigation dropdown

1 REPLY 1

Re: static blocks

Hi ,

You can add static block using below ways in navigation dropdown.

Call a Static Block to your .xml files in Magento: Go to your .xml file in your LAYOUT folder. Just paste this code:
<block type="cms/block" name="cms_test_block" before="-">
    <action method="setBlockId"><block_id>cms_test_block</block_id></action>
</block>

You can call it by it’s name in file .phtml
<?php echo $this->getChildHtml('cms_test_block') ?>


Call a Static Block to your .phtml files in Magento: Go to your .phtml file, where you would like that static block to appear, then paste this code:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId(cms_test_block)->toHtml() ?>

 

Hope this helps you!

Problem Solved! Click Kudos & Accept as Solution!