Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Trying to move <?php echo $this->getChildHtml(’topMenu’) ?> to 2columns-right.phtml
 
toadx
Jr. Member
 
Total Posts:  21
Joined:  2008-06-19
 

I want to move the topMenu part to a different part of the page.  Basically I just want to take <?php echo $this->getChildHtml('topMenu') ?> and put it in to the 2columns-right.phtml file.  When I do this, it never displays the categories menu.  Suggestions?  Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
toadx
Jr. Member
 
Total Posts:  21
Joined:  2008-06-19
 

Actually it looks like I figured out a way to do what I want using some comments from here http://www.magentocommerce.com/boards/viewthread/4722/ .  I’d still like to know the technical reason why <?php echo $this->getChildHtml('topMenu') ?> won’t work from 2columns-right.phtml though.  I think it has something to do with some stuff on the XML files, but I’m not totally sure.  Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrgoodfox
Member
 
Avatar
Total Posts:  69
Joined:  2009-05-11
Dallas, TX
 

I’m too hoping someone answers this question.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
raduispas
Jr. Member
 
Total Posts:  1
Joined:  2011-03-17
 

I had the same problem and I don’t know why it works,but here it is what I did :

In page.xml I wrote this :

<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
                    <
label>Navigation Bar</label>
                    <
block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
            </
block>

instead of just writing :

<block type="core/text_list" name="top.menu" as="topMenu"/>

Then I edited the file app/design/frontend/mytheme/template/page/html/topmenu.phtml (create if not present) :

<?php $_menu $this->getHtml('level-top'?>
<?php 
if($_menu): ?>
<div class="nav-container">
    <
ul id="nav">
        
<?php echo $_menu ?>
    
</ul>
</
div>
<?php endif ?>

And in the end i edited app/design/frontend/mytheme/template/page/2columns-right.phtml :

<div id="menu">
            <
div class="grid_18">                  
                
<?php echo $this->getChildHtml('topMenu'?>                               
            
</div>
            <
div class="grid_6">
                <
div class="mini_cart"><?php echo $this->getChildHtml('cart_sidebar'?></div>
            </
div>
        </
div>

At long last,the menus are displayed. Hope this helps someone smile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top