1

I'm having trouble displaying links within my navigation from a static block.

I have included the following code at the top of my "home.phtml" file:

<?php $storeId = Mage::app()->getStore()->getStoreId();
if($storeId == '14')
{
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-center-contact')->toHtml();
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('top_menu_beacon')->toHtml();
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_links_beacon')->toHtml();
}
if($storeId == '19')
{
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-center-contact')->toHtml();
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('top_menu_cashino')->toHtml();
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_links_cashino')->toHtml();
}
if($storeId == '16')
{
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-center-contact')->toHtml();
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('top_menu_tanexpress')->toHtml();
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_links_tanexpress')->toHtml();
}
if($storeId == '18')
{
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-center-contact')->toHtml();
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('top_menu_merkur')->toHtml();
 echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_links_merkur')->toHtml();
}
?>
asked Sep 6, 2018 at 10:20
1
  • Did you added all the static block which you are using in your code? Commented Sep 6, 2018 at 10:38

2 Answers 2

4
You can follow below steps for display static block:
Step 1)Go to admin.
Step 2)Open Top menu System->Permissions->Blocks.
Step 3)click "Add New Block".
write your "Block Name" and Is Allowed "Yes".
Note: Block Name is type of your block for example "cms/block"
after Save Block. 
Step 4)Clear cache and refresh front page. Now Block is showing.
Thanks!
answered Sep 6, 2018 at 10:26
0

Tried to follow @Kirti Nariya's steps, follow below steps if you don't succeed in it.

1) If you use the latest Magento version 1.9.2.2, then you need to add first the block to Magento whitelist in the backend: System -> Permissions -> Block

For more details check below link http://www.dudesquare.nl/blog/2015/10/31/static-block-shortcodes-not-working-1-9-2-2/

answered Oct 8, 2018 at 6:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.