Question

I have configured multi site in my magento website. I follow the following link http://www.magentocommerce.com/magento-on-the-fly/multiple-sites/ Now When I visited the my new secondry site I noted that the navigation menu contains the same pages as in the main site. And I want that when I added a cms/page to the secondary site it should display in the navigation menu of the secondary site and not in the main site. And when I add the cms/page to the main site it should display in the navigation menu of the main site and not in the secondary site. So How will I do this. Here is my code in the navigation/top.phtml

<?php $_menu_cms = Mage::getModel('cms/page')->getCollection(); ?>
<div id="menu_nav">

    <ul>
        <?php foreach($_menu_cms as $cmspage): ?>
<?php $page = $cmspage->getData(); ?>
<?php if($page['identifier'] == "no-route" || $page['is_active'] == "0" || $page['identifier'] == "enable-cookies"){ } else { ?>
<?php if($page['title'] == "About" || $page['title'] == "asd" || $page['title'] == "Products" || $page['title'] == "Home") {?>
<?php echo "<li><a href=\"".$page['identifier']."\" title=\"".$page['title']."\">".$page['title']."</a></li>"; ?>
<?php }} ?>
<?php endforeach; ?>
    </ul>
</div>
Was it helpful?

Solution

Change the first line to:

<?php
    $_menu_cms = Mage::getModel('cms/page')->getCollection()
               ->addStoreFilter(Mage::app()->getStore());
?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top