Skip to main content
2 of 2
title change apge to page and some content change

Having issue with left navigation menu in CMS page

I am working on magento 1.9 using luxury theme

I am loading left navigation using mega menu inside static block. like this

{{block type="megamenu/vertical" menu_id="3" template="megamenu/vertical.phtml"}}

and calling this static block inside 2columns-left.phtml like this echo $this->getLayout()->createBlock('cms/block')->setBlockId('about-us-1')->toHtml();

for this i am checking which cms page is loading in if condition

$cmsPageUrlKey = Mage::getSingleton('cms/page')->getIdentifier();
if ($cmsPageUrlKey == "corporate-overview" || $cmsPageUrlKey == "history" || $cmsPageUrlKey == "vision-mission" || $cmsPageUrlKey == "awards" || $cmsPageUrlKey == "certifications") {
    echo $this->getLayout()->createBlock('cms/block')->setBlockId('about-us-1')->toHtml();
    
} else if ($cmsPageUrlKey == "ffs-policy" || $cmsPageUrlKey == "emergency-service-policy" || $cmsPageUrlKey == "warranty-details" || $cmsPageUrlKey == "spare-key-requirment" || $cmsPageUrlKey == "security-tips" || $cmsPageUrlKey == "lock-care" || $cmsPageUrlKey == "master-key" || $cmsPageUrlKey == "access-control-systems" || $cmsPageUrlKey == "common-key") {
    echo $this->getLayout()->createBlock('cms/block')->setBlockId('services1')->toHtml();
} else if ($cmsPageUrlKey == "overview" || $cmsPageUrlKey == "join-us") {
    echo $this->getLayout()->createBlock('cms/block')->setBlockId('career-page')->toHtml();
}

This code works but after opening 3-4 cms pages It is loading random menu on each pages.

what will be the issue ?

parish
  • 151
  • 2
  • 9