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

left side caterogy list
 
hallowed
Jr. Member
 
Total Posts:  21
Joined:  2008-08-19
 

Sander,

Thank you but I tried your code for the left hand sub-category and it didn’t change anything.

Is there something missing?

I have the latest version of Magento.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sander
Sr. Member
 
Avatar
Total Posts:  232
Joined:  2008-01-08
Netherlands
 
hallowed - 24 August 2008 12:41 AM

Sander,

Thank you but I tried your code for the left hand sub-category and it didn’t change anything.


Is there something missing?

I have the latest version of Magento.

I was in a hurry, saw that I copy pasted the wrong template file. My subcategories-on-left-side template looks like this:

<ul class="sub-nav">
<?php
$counter = 2;
foreach ($this->getCurrentChildCategories() as $_category): ?>
<?php echo $this->drawItem($_category, null, null, $counter);
$counter++;
?>
<?php endforeach ?>
</ul>

Forget about the counters, but as you can see the only thing I really did was get the child categories and use the drawItem function to render them. The only thing I can think of in your case is that your currently active category is the shop’s default/root category. Your main categories are children of the shop’s default category, so they get outputted. Other than that, can’t come up with a quick explanation smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
CypherUk
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-06-23
Essex, UK
 

Hi Guys.

Please forgive my stupidity on this subject, but i have been going for 2 hours and still i can’t get my left category menu to show confused

I’ve tried referencing the left.phtml file in my template Layout Update XML but the category menu wont show on the left. I know this is probably just something simple but for the life of me i cant figure it out.

Can anyone throw me a lifeline and point me in the right direction.

Any advice will be welcomed with many thanks and handfuls of removed hair wink

Mark

Using Magento 1.1.3

 
Magento Community Magento Community
Magento Community
Magento Community
 
yonirad
Jr. Member
 
Total Posts:  11
Joined:  2008-08-22
 

Does anyone have the right code and specific instructions to get static categories in the left?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrgad
Member
 
Total Posts:  60
Joined:  2008-08-29
 

edit - solved.

 
Magento Community Magento Community
Magento Community
Magento Community
 
hunterfox
Jr. Member
 
Total Posts:  1
Joined:  2008-09-05
 

Problem solved

 
Magento Community Magento Community
Magento Community
Magento Community
 
bulldog
Jr. Member
 
Total Posts:  8
Joined:  2008-07-04
 

Can somebody publish a clean code for both the default and modern theme? or add this to the connect manager?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Naresh Vajawat
Member
 
Total Posts:  47
Joined:  2008-09-22
India
 

Hi,

I just tried the same stuff by copying my Horizontal menu and adding width for the vertical stuff but the menu still comes over the menu and not on the side. Please find my menu.css file. I am also attaching my vert-nav.phtml. Please let me know where I went wrong.

File Attachments
menu.css  (File Size: 5KB - Downloads: 238)
vert_nav.phtml  (File Size: 2KB - Downloads: 348)
 
Magento Community Magento Community
Magento Community
Magento Community
 
breastfed
Sr. Member
 
Avatar
Total Posts:  194
Joined:  2007-09-24
Münster - Germany
 

If you want to have the LI’s under each other for the vertical Nav, i would delete “#nav_vert li { float:left; }” because the LIs are floating.

Maybe this work for you.

Regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nicky
Jr. Member
 
Total Posts:  5
Joined:  2008-01-08
 

Well, first post and thankful re: coding for the side navigation.. thankfully it is working great for me - the thing Im not sure how to do is make it so that the categories only show in the side navigation and not in the top navigation as there are too many categories for the top nav.

I would like to have a few showing in the top nav.. but not all.

Could anyone enlighten me how to not show all the categories in the top nav.. but make sure they show in the side nav?

Any help much appreciated smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
breastfed
Sr. Member
 
Avatar
Total Posts:  194
Joined:  2007-09-24
Münster - Germany
 

Hello

if the TOP Nav Points won’t change often, you could hardcode the TOP Nav.
For Example.

Regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nicky
Jr. Member
 
Total Posts:  5
Joined:  2008-01-08
 

Thanks for the reply - I understand what you are saying, but it means I won’t get the subcategories (I think?).
Obviously if you have alot of categories, they will not all fit onto the top nav.. therefore an alternative option is pretty important.. is this something already integrated into Magento? Considering I’m just getting the hang of the programme, it wouldn’t surprise me if I missed something here.

The other thing is I have applied Peter Hamilton’s side nav to the site, but it isnt SEO friendly, in the sense that search engines won’t spider the sub-categories - therefore, idealy, the current top nav structure would be great to have on, lets say the left, and only a chosen selection on the top nav.

I’m pretty sure many have achieved this already.. so any help with this would be appreciated loads!

Thanks in advance smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
cooee
Sr. Member
 
Avatar
Total Posts:  100
Joined:  2007-08-31
Aachen, Germany
 

Hi there,

is there a final solution yet? I mean, having the category list on the left-hand side of the page is a very straightforward thing in an online shop. What I cannot seem to get my head around is that changing the catalog.xml to contain something like this:

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

works like a charm, but changing this to

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

does not output the category list, although there is a template file called “left.phtml”. Very strange.

Cheers,
cooee

 
Magento Community Magento Community
Magento Community
Magento Community
 
btbc
Sr. Member
 
Total Posts:  95
Joined:  2008-06-11
 

Any way to alter this to show a brands/manufacturer list?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sensi
Sr. Member
 
Total Posts:  103
Joined:  2008-07-31
Paris, France
 

Following Chris Norton’s Accordion Navigation example here: http://www.chnorton.com.au/2008/06/14/accordion-navigation/

vert_nav.phtml :

<div class="vertical-nav-container box base-mini">
    <
div class="vertical-nav">
        <
div class="head">
        <
h4><?php echo $this->__('Navigation'?></h4>
        </
div>
        <
ul id="nav_vert">
        
<?php foreach ($this->getStoreCategories() as $_category):
        
<?php echo $this->drawLeftNavItem($_category?>
        <?php 
endforeach; ?>
        
</ul>
    </
div>
</
div>

overridden app/code/local/MyCompany/Catalog/Block/navigation.php :

class MyCompany_Catalog_Block_Navigation extends Mage_Catalog_Block_Navigation
{
 
    
public function drawLeftNavItem($category$level=0$last=false)
    
{
        $html 
'';
        if (!
$category->getIsActive()) {

            
return $html;
        
}

        $children 
$category->getChildren();
        
$hasChildren $children && $children->count();
        
$html.= '<li';

        
$html.= ' class="level'.$level;
        
$html.= ' nav-'.str_replace('/''-'$category->getRequestPath());
        if (
$this->isCategoryActive($category)) {
            $html
.= ' active';
        
}
        
if ($last{
            $html 
.= ' last';
        
}
        
if ($hasChildren && $this->isCategoryActive($category)) {
            $cnt 
0;
            foreach (
$children as $child{
                
if ($child->getIsActive()) {
                    $cnt
++;
                
}
            }
            $html 
.= ' parent';
        
}
        $html
.= '">'."\n";
        
$html.= '<a href="'.$this->getCategoryUrl($category).'"><span>'.$this->htmlEscape($category->getName()).'</span></a>'."\n";
        
//$html.= '<span>'.$level.'</span>';

        
if ($hasChildren && $this->isCategoryActive($category)) {

            $j 
0;
            
$htmlChildren '';
            foreach (
$children as $child{
                
if ($child->getIsActive()) {
                    $htmlChildren
.= $this->drawLeftNavItem($child$level+1, ++$j >= $cnt);
                
}
            }

            
if (!empty($htmlChildren)) {
                $html
.= '<ul class="level' $level '">'."\n"
                        
.$htmlChildren
                        
.'</ul>';
            
}

        }
        $html
.= '</li>'."\n";
        return 
$html;
    
}

}

app/code/etc/modules/MyCompany_Catalog.xml :

<?xml version="1.0"?>
<config>
  <
modules>
    <
MyCompany_Catalog>
      <
active>true</active>
      <
codePool>local</codePool>
    </
MyCompany_Catalog>
  </
modules>
</
config>

app/code/local/MyCompany/Catalog/etc/config.xml :

<?xml version="1.0"?>
<config>
  <
modules>
    <
MyCompany_Catalog>
      <
version>0.1.0</version>
    </
MyCompany_Catalog>
  </
modules>
  <global>
    <
blocks>
      <
catalog>
        <
rewrite>
          <
navigation>MyCompany_Catalog_Block_Navigation</navigation>
        </
rewrite>
      </
catalog>
    </
blocks>
  </global>
  <
frontend>
          <
translate>
            <
modules>
                <
MyCompany_Catalog>
                    <
files>
                        <default>
Mage_Catalog.csv</default>
                    </
files>
                </
MyCompany_Catalog>
            </
modules>
        </
translate>
  </
frontend>
</
config>

Some quick css to try it:

ul#nav_vert ul.level0 {
    
list-style-type:circle;
}
ul
#nav_vert ul.level1 {
    
list-style-type:square;
}

ul
#nav_vert li a:link,
ul#nav_vert li a:visited,
ul#nav_vert li ul li a:link,
ul#nav_vert li ul li a:visited,
ul#nav_vert li ul li ul li a:link,
ul#nav_vert li ul li ul li a:visited {
    
font-size:11px;
    
font-weight:bold;
    
color:#999999;
    
letter-spacing:0.1em;
    
text-align:left;
    
text-decoration:none;
}

ul
#nav_vert li a:link,
ul#nav_vert li a:visited {
    
line-height:20px;
    
text-transform:uppercase;
}

ul
#nav_vert li ul li a:link,
ul#nav_vert li ul li a:visited,
ul#nav_vert li ul li ul li a:link,
ul#nav_vert li ul li ul li a:visited {
    
line-height:16px;
    
text-transform:none;
}

ul
#nav_vert li a:hover,
ul#nav_vert li.active a,
ul#nav_vert li ul li a:hover,
ul#nav_vert li ul li.active a,
ul#nav_vert li ul li ul li a:hover,
ul#nav_vert li ul li ul li.active a {
    
color:#000000;
    
}

ul
#nav_vert li ul {
    
margin:0 0 0 20px;
}

ul
#nav_vert li ul li a:hover,
ul#nav_vert li ul li ul li a:hover {
    
text-decoration:underline;
}

Regards.

Image Attachments
accordion.gif
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top