Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Left Navigation? 
 
Andrea, Argentina
Sr. Member
 
Total Posts:  158
Joined:  2007-12-05
Buenos Aires, Argentina
 

I want to know if someone could give me a guide to move the top navigation to a left navigation in a frontend with 3 columns.
I want the left column to have the nav with categories and subcategories as it is now at the top.
It would be great to know because I think that here is one of the keys to learn how to design with Magento.

Thank you
Andrea

 
Magento Community Magento Community
Magento Community
Magento Community
 
till
Member
 
Total Posts:  36
Joined:  2007-12-17
 

I tried the same… but no luck.

I figured out that there is a template for the left navigation and I tried to add the following in catalog.xml:

<block type="catalog/navigation" name="catalog.leftnav" template="catalog/navigation/left.phtml"/>

(Added it in <reference name="left" />.)

But that just renders the page useless, it seems to “die” right at this definition. I also enabled system and exceptions logs, but they are not written (I even touch’ed them and made sure the files and log directory are writable by the webserver).

 
Magento Community Magento Community
Magento Community
Magento Community
 
madman2
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2008-02-08
Newcastle
 

I created a test page in CMS/ manage pages.
Under Custom Design
add the following into Layout Update XML

<reference name="left">
<block type="catalog/navigation" name="home.catalog.navigation" alias="navigation_left" template="catalog/navigation/simple_edge_nav.phtml" />
</reference>

In the \\your host name\www\magento\app\design\frontend\default\default\template\catalog\navigation directory I created a new template as the existing left.phtml is broken.

simple_edge_nav.phtml

<?php 
/**
 * Top menu for store
 *
 * @see Mage_Catalog_Block_Navigation
 */
?>
<div class="box">
    <
div class="side-nav">
        <
h4 class="no-display"><?php echo $this->__('Category Navigation:'?></h4>
        <
ul id="side-nav" >
        
<?php foreach ($this->getStoreCategories() as $_category): ?>
            <?php 
echo $this->drawItem($_category?>
        <?php 
endforeach ?>
        
</ul>
    </
div>
    
<?php echo $this->getChildHtml('topLeftLinks'?>
</div>

It’s a start anyway, now all you have to do is add the CSS to this that’ll make it look good. It also contains the basics for category menu.

Madman2, madman1 just wasn’t committed enough.  ecommnet squashed-tomato autobestbuy offexploring

 
Magento Community Magento Community
Magento Community
Magento Community
 
till
Member
 
Total Posts:  36
Joined:  2007-12-17
 

I totally forgot that I was running with display_errors = off when I debugged this, hence no useful “input”. But anyway, tracked it down so far:

public function getCurrentCategory()
    
{
        $category 
$this->getData('current_category');
        if (
is_null($category)) {
            
if ($category Mage::registry('current_category')) {
                $this
->setData('current_category'$category);
            
}
            
else {
                $category 
false;
                
$this->setData('current_category'$category);
            
}
        }
        
return $category;
    
}

This function returns “false” (for whatever reason) and this effectively breaks (= fatals) the rest of the page:

Fatal error: Call to a member function getChildren() on a non-object in /path/magento/1.0/app/code/core/Mage/Catalog/Block/Navigation.php on line 77

There is also a docbug in Mage_Catalog_Model_Layer::getCurrentCategory(). It states that the function returns “Mage_Catalog_Model_Category”, when it can also return a boolean. This should be corrected as well. Also, I’d appreciate inline comments why it can be false after all.

@Madman2: Thanks for posting this snippet!

Cheers,
Till

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53191 users|739 users currently online|107221 forum posts