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

Category in top navigation bar
 
MagDevel
Jr. Member
 
Total Posts:  8
Joined:  2007-11-30
South Korea
 

Hi Devs,
I have a problem with displaying category in top navigation bar. I have this code for template/catalog/navigation/top.phtml

<div class="header-nav-container">
    <
div class="header-nav">
        <
ul id="nav">
        <
li><a href="http://www.sitename.com/">Home</a></li>
        
<?php
        
//Category setup
        
foreach ($this->getStoreCategories(5) as $_cat{
            $this
->drawItem($_cat);
        
}
        ?>
    
</div>
</
div>
Theoretically, it should display categories beside “Home” link but I didn’t see anything.

I tried to find the function reference (it’s like finding needle) and found this function from app/code/core/Mage/Catalog/Helper/Category.php

public function getStoreCategories($maxChildLevel=1)
    
{
        $parent 
Mage::app()->getStore()->getConfig('catalog/category/root_id');
        return 
$this->_getChildCategories($parent$maxChildLevel);
    
}
Where should i find the vale for catalog/category/root_id?

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagDevel
Jr. Member
 
Total Posts:  8
Joined:  2007-11-30
South Korea
 

Anybody knows where to get online function reference for Magento? Or should I wait until official API reference released?

 
Magento Community Magento Community
Magento Community
Magento Community
 
YoavKutner
Guru
 
Avatar
Total Posts:  491
Joined:  2007-08-08
 

We are working on documentation and it should be made available with the release of the first stable version.

Thanks

yoav

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jonathan Hedrén
Member
 
Total Posts:  67
Joined:  2007-08-31
Sweden
 

While waiting, try using Eclipse with the PDT-plugin and you will get a quite nice class/function-reference.

 
Magento Community Magento Community
Magento Community
Magento Community
 
RD12
Jr. Member
 
Total Posts:  3
Joined:  2008-03-21
 

grep also works very well when trying to find functions hiding in code.

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