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

How Do I Show Subcategories at Top Level in the Navigation Menu? 
 
sjdalton
Jr. Member
 
Total Posts:  6
Joined:  2012-09-08
 

I would like to have subcategories be displayed as though they were main categories in the menu bar but keep the advantages that come with having a parent category.

The reason for this is structural planning for the future.

At the moment my planned category structure is

root-category
  city
-1
    subcategory
-1
    subcategory
-2
  city
-2
    subcategory
-1
    subcategory
-2
  city
-3
    subcategory
-1
    etc
I want the URLs to be like this:
domain/city/subcategory/

BUT at the moment I have only products & content for City 1 and this will not change soon, so I want the menu bar to display the subcategories but I want the URL to retain the city in the URL.

I understand this can be achieved with URL rewrites?  But for all subcategories and products it will take a very long time.  The only other idea is to change the root domain to domain/city/

Any other ideas? Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
hxd
Sr. Member
 
Avatar
Total Posts:  224
Joined:  2011-02-03
 

To add a custom link to the top navigation bar you need to edit the top.phtml file of your theme. If, for example, you use the default theme the path to the file on your hosting account will be app/design/frontend/base/default/template/catalog/navigation/top.phtml. In the file find the following code:

<div class="nav-container">

<
ul id="nav">

<?php echo $_menu ?>

</ul>

</
div>

Between the <ul> tags put the following code:

<li><a href="http://yourdomain.com/city/subcategory1"><span>Your Menu Link Name</span></a></li>

So that the code looks like this:

<div class="nav-container">

<
ul id="nav">

<?php echo $_menu ?>

<li><a href="http://yourdomain.com/city/subcategory1"><span>Your Menu Link Name</span></a></li>

</
ul>

</
div>

Then flush the cache and refresh the frontend of your site.

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sjdalton
Jr. Member
 
Total Posts:  6
Joined:  2012-09-08
 

Hi,

Thanks for your response.

I don’t think this achieves quite what im after.  Im not looking to create a custom link and with the theme I have installed it doesn’t work in the same way you’ve suggested.

Essentially I want a /city/ to be included in the url but not in the db as a category.  This will then display my current parent categories in the navigation menu as they should be have the /city/ sub directory prefixed to the beginning of the url from the root, e.g.

http://www.domain.com/city/parent-category/sub-category/product

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 

Hi! You can use Improved Navigation Extension to do this.

Also Improved Navigation Extension includes great functionality for very reasonable price. SEO functionality, filter adjustments, advanced categories, ajax layered navigation, price range slider.

See the live demo here http://improved-navigation.amasty.com/
Find the detailed user guide here http://amasty.com/improved-navigation.html

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