如何将页面添加到多站点中的导航菜单?
我在我的 magento 网站中配置了多站点。我点击以下链接 http://www.magentocommerce.com/magento-on-the-飞行/多个站点/ 现在,当我访问新的辅助站点时,我注意到导航菜单包含与主站点中相同的页面。 我希望当我向辅助站点添加 cms/页面时,它应该显示在辅助站点的导航菜单中,而不是显示在主站点中。当我将 cms/页面添加到主站点时,它应该显示在主站点的导航菜单中,而不是显示在辅助站点中。 那么我将如何做到这一点。 这是我在 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>
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将第一行更改为:
Change the first line to: