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

Category won’t un-anchor
 
Brady
Guru
 
Avatar
Total Posts:  330
Joined:  2007-09-10
Orange County, CA
 

I just created a new category that I do not want anchored (to show up in the navigation bar).  However, it does show up in the navigation bar, even though “anchor” is selected to “no”.

Is this a known bug?  Anybody else having this problem or know a possible fix?

Thanks!

Image Attachments
Picture 1-1.jpgPicture 2.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

Hi bro, I don’t think that it come from anchor.....

try ‘is active’ drop down list button , and select ‘No’....

Hope this is the answer you want

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brady
Guru
 
Avatar
Total Posts:  330
Joined:  2007-09-10
Orange County, CA
 

That partially works.  It does remove the category from the nav bar, which is what I want.  But I also need the category to be active so people can manually go to the URL.  By deactivating the category, it kills it completely.

 
Magento Community Magento Community
Magento Community
Magento Community
 
PierMarketing
Sr. Member
 
Total Posts:  77
Joined:  2008-02-20
 

Brady,

Have you figured this out?  I need to do the same thing!

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brady
Guru
 
Avatar
Total Posts:  330
Joined:  2007-09-10
Orange County, CA
 

Unfortunately, no.  If I recall correctly, in EARLY betas of Magento, the “Is Anchor” option controlled whether or not the category showed up in the navigation.  The last time I tried it, the “Is Anchor” option didn’t seem to do anything.

I have not heard from anybody from Magento regarding this issue, so I don’t know if it’s a bug, or if it’s doing something that I’m not seeing, but I too would like to know.

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  236
Joined:  2008-01-10
London
 

If you are using the Magento default theme ver. 1.0.19870.4

just a suggestion for a very simple template hack

keep category as “active” and go to

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

and add

<?php if ($this->htmlEscape($_category->getName()) != '[whatever-the-name-of-your-catalog]') : ?>

immediately after

<?php foreach ($this->getStoreCategories() as $_category): ?>

not forgetting

<?php endif; ?>

immediately before

<?php endforeach ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Brady
Guru
 
Avatar
Total Posts:  330
Joined:  2007-09-10
Orange County, CA
 

That’s a good work-around, thanks! It works great for a temporary solution.

For a permanent fix, I do is an ‘isActive’ call in app > code > core > Mage > Catalog > Block > Navigation.php, but it refers to Child Categories:

public function getCurrentChildCategories()
    
{
        $layer 
Mage::getSingleton('catalog/layer');
        
$category   $layer->getCurrentCategory();
        
/* @var $category Mage_Catalog_Model_Category */
        
$collection Mage::getModel('catalog/category')->getCollection();
        
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
        
$collection->addAttributeToSelect('url_key')
            ->
addAttributeToSelect('name')
            ->
addAttributeToSelect('is_anchor')
            ->
addAttributeToFilter('is_active'1)
            ->
addIdFilter($category->getChildren())
            ->
joinUrlRewrite()
            ->
load();

        
$productCollection Mage::getResourceModel('catalog/product_collection');
        
$layer->prepareProductCollection($productCollection);
        
$productCollection->addCountToCategories($collection);
        return 
$collection;
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
jo_dadday
Jr. Member
 
Total Posts:  3
Joined:  2008-08-13
 

If someone is still looking for a solution to this, an easy way to accomplish it is to go to Catalog/Manage Categories, and drag the category so that it is on the same level as “Root”, and not under it. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brady
Guru
 
Avatar
Total Posts:  330
Joined:  2007-09-10
Orange County, CA
 

I’ve tried that, but then I can’t access the page from the public site (at least in previous versions - perhaps it’s corrected).

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