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

Modify top navigation style
 
radge
Member
 
Total Posts:  40
Joined:  2008-10-04
 

Hi , i’m trying to modify top navigation from default template.

Now , top navigation show category and then childs , and i’m trying to modify “category1 - child1-child2 category2 - child1-child2 “

I’m looking this file that contains this code

/app/design/frontend/default/default/template/catalog/navigation/top.phtml

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

Anyone know how to do it ?

thxs , radge

 
Magento Community Magento Community
Magento Community
Magento Community
 
radge
Member
 
Total Posts:  40
Joined:  2008-10-04
 

I’m trying it but doesn’t work

<?php foreach ($this->getStoreCategories() as $_category): ?>
            <?php 
echo $this->drawItem($_category?>
                <?php 
foreach ($this->getCurrentChildCategories() as $_subcategory): ?>
                    <?php 
echo $this->drawItem($_subcategory?>
                    <?php 
endforeach ?>
                <?php 
endforeach ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

I think I kinda understand what you want to achieve. You will have a better chance by playing with the menu.css file I think.

As far as markup’s concerns, the subcategories are wrapped inside the category, thus it looks exactly like what you want to achieve visually. Just turn off the CSS style from your browser so that you can see it clearly.

<ul><li>category1
<ul> <li> child1</li>
<li> child2</li>
</ul>
</ul>
CSS tips: float or display inline the category and childcateogry

Presentation wise, I can’t picture how you would want to do it this way: “category1 - child1-child2 category2 - child1-child2 “

edit: One more thing, the ‘top.php’ uses mouseover to trigger the dropdown behaviour. You will need to hack the code too.

 
Magento Community Magento Community
Magento Community
Magento Community
 
radge
Member
 
Total Posts:  40
Joined:  2008-10-04
 

I’m looking it.

Turning css OFF I can see that.
Attach file : 1st jpg

And I don’t know how to do this result , that I Need.
Attach file : 2nd jpg

Thxs for all , radge

Image Attachments
bad.jpggood.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top