1

I want that in my magento shop with vertnav meniu(3 levels) first level would be open by default. Example:

> AA
> -1a
> -2a
> -3a
> BB

But now I have:

> AA
> BB

There is in configuration way to make all levels expanded, but i dont need that, because then it would be like this:

> AA
> -1a
>  -1aaa
>  -2aaa
> -2a
> -3a
> BB

Is there any way?

Kappa
  • 1,015
  • 1
  • 16
  • 31
Adomas
  • 289
  • 2
  • 4
  • 16

2 Answers2

1

I am not using this vertnav module so I hope my answer won't be out of topic even if it is a good and Magento-correct solution.

The idea is to use the "catalog/navigation" class (Block) that is just perfect for what you want to do. A bit of twicking with CSS and / or jQuery UI carousel if you will, and you're perfectly done!

1- Update layouts

Open your theme's catalog.xml layout file and add the following in the <default> node :

<reference name="left">
  <block type="catalog/navigation" name="left.categories" before="-" template="catalog/navigation/left-categories.phtml"/>
</reference>

Make sure that :

  • your <layout> node doesn't already have a <reference name="left"> node. If so, just append the <block type="catalog/navigation".../> to it
  • the template for this page is 2columns-left.phtml or update the reference name stated above accordingly.

2- Create the template file

In your theme's template folder create this file : /catalog/navigation/categories-left.phtml and add the following content :

<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>
<?php if($_menu): ?>
<div class="left-categories-container">
    <ul id="left-categories">
        <?php echo $_menu ?>
    </ul>
</div>
<?php endif ?>

On the frontend you now have a nice list of all your store categories with all necessary CSS classes already in place for tweaking and making the ones you want to appear where and when you want whether you're on an active category or want to display only any level of depth or anything else. It is as simple as playing with CSS ! You can get inspiration from the #nav lines in the original template (blank theme is really to be preferred).

Hervé Guétin
  • 4,392
  • 4
  • 29
  • 36
1

When I look at the vertnav module (System > Configuration > Catalog > Category Vertical Navigation) there is an option for "Expand all max depth". I guess you would need to set this to 2.

clockworkgeek
  • 37,650
  • 9
  • 89
  • 127