Search code examples
iphonemagentomobile-websitemagento-1.9

Magento iPhone theme: How to show categories instead of main navigation bar?


I'm using default magento iPhone theme for mobile viewers of my website, but defaultly iPhone theme show main navigation bar on the home page. But I need to show category list instead of main navigation bar. How should I do it ?


Solution

  • I have solved this problem by making a new phtml file called category.phtml in directory iPhone/template/catalog/navigation for category using http://fishpig.co.uk/magento/tutorials/display-categories-and-subcategories-in-magento/ code.

    Then I have called it to page.xml file in directory iPhone/layout inside my footer block

    <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>
    

    then after that I have simply called created category.phtml file in footer.phtml located in iphone/template/page/html using getChildHtml function like below

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

    hope this will help