【问题标题】:Magento iPhone theme: How to show categories instead of main navigation bar?Magento iPhone 主题:如何显示类别而不是主导航栏?
【发布时间】:2014-08-24 09:35:27
【问题描述】:

我正在为我的网站的移动查看器使用默认的 magento iPhone 主题,但默认情况下 iPhone 主题会在主页上显示主导航栏。但我需要显示类别列表而不是主导航栏。我该怎么做?

【问题讨论】:

    标签: iphone magento mobile-website magento-1.9


    【解决方案1】:

    我已经解决了这个问题,方法是在 iPhone/template/catalog/navigation 目录中使用http://fishpig.co.uk/magento/tutorials/display-categories-and-subcategories-in-magento/ 代码为类别创建一个名为 category.phtml 的新 phtml 文件。

    然后我将其调用到页脚块内 iPhone/layout 目录中的 page.xml 文件

    <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
                <block type="catalog/navigation" name="catalog.left" as="cat_left" template="catalog/navigation/category.phtml"/>
    
    </block>
    

    然后,我使用 getChildHtml 函数在位于 iphone/template/page/html 中的 footer.phtml 中简单地调用了创建的 category.phtml 文件,如下所示

    <div id="navigation">
    <?php echo $this->getChildHtml('cat_left')?></div>
    

    希望这会有所帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多