Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7035743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:20:26+00:00 2026-05-28T01:20:26+00:00

I am building a custom navigation menu in Magento which displays the categories from

  • 0

I am building a custom navigation menu in Magento which displays the categories from a different store with a different root category from the current store. Some of the categories should be hidden as they have ‘Include in Navigation Menu’ set to No.

It should be possible to read this attribute from the category model as in this question: How do I detect if a category has Include in Navigation Menu set to NO?

However $category->getIncludeInMenu() is returning NULL for all categories on my Magento EE 1.11 installation.

// Load child categories for a specific root category
$_uk_default_root_id = Mage::app()->getStore('uk_default')->getRootCategoryId();
$_uk_default_root_category = Mage::getModel('catalog/category')->load($_uk_default_root_id); 
$_sub_categories = $_uk_default_root_category->getChildrenCategories();

// Loop through the categories
foreach ($_sub_categories as $_category)
{
    if ($_category->getIsActive() && $_category->getIncludeInMenu())
    {
        <echo navigation link>
    }
}

A var dump of one of the categories shows no ‘include_in_menu’ attribute, although the ‘is_active’ attribute works as expected. Is there an alternative way to determine if a category should be displayed in the navigation?

Var dump of category object:

object(Mage_Catalog_Model_Category)[423]
  protected '_eventPrefix' => string 'catalog_category' (length=16)
  protected '_eventObject' => string 'category' (length=8)
  protected '_cacheTag' => string 'catalog_category' (length=16)
  protected '_useFlatResource' => boolean false
  private '_designAttributes' => 
    array (size=6)
      0 => string 'custom_design' (length=13)
      1 => string 'custom_design_from' (length=18)
      2 => string 'custom_design_to' (length=16)
      3 => string 'page_layout' (length=11)
      4 => string 'custom_layout_update' (length=20)
      5 => string 'custom_apply_to_products' (length=24)
  protected '_treeModel' => null
  protected '_defaultValues' => 
    array (size=0)
      empty
  protected '_storeValuesFlags' => 
    array (size=0)
      empty
  protected '_lockedAttributes' => 
    array (size=0)
      empty
  protected '_isDeleteable' => boolean true
  protected '_isReadonly' => boolean false
  protected '_resourceName' => string 'catalog/category' (length=16)
  protected '_resource' => null
  protected '_resourceCollectionName' => string 'catalog/category_collection' (length=27)
  protected '_dataSaveAllowed' => boolean true
  protected '_isObjectNew' => null
  protected '_data' => 
    array (size=15)
      'entity_id' => string '16' (length=2)
      'entity_type_id' => string '3' (length=1)
      'attribute_set_id' => string '3' (length=1)
      'parent_id' => string '15' (length=2)
      'created_at' => string '2011-11-16 12:16:27' (length=19)
      'updated_at' => string '2011-12-19 16:19:08' (length=19)
      'path' => string '1/15/16' (length=7)
      'position' => string '1' (length=1)
      'level' => string '2' (length=1)
      'children_count' => string '8' (length=1)
      'is_active' => string '1' (length=1)
      'request_path' => null
      'name' => string 'Vacuum Cleaners' (length=15)
      'url_key' => string 'vacuum-cleaners' (length=15)
      'is_anchor' => string '1' (length=1)
  protected '_hasDataChanges' => boolean true
  protected '_origData' => 
    array (size=15)
      'entity_id' => string '16' (length=2)
      'entity_type_id' => string '3' (length=1)
      'attribute_set_id' => string '3' (length=1)
      'parent_id' => string '15' (length=2)
      'created_at' => string '2011-11-16 12:16:27' (length=19)
      'updated_at' => string '2011-12-19 16:19:08' (length=19)
      'path' => string '1/15/16' (length=7)
      'position' => string '1' (length=1)
      'level' => string '2' (length=1)
      'children_count' => string '8' (length=1)
      'is_active' => string '1' (length=1)
      'request_path' => null
      'name' => string 'Vacuum Cleaners' (length=15)
      'url_key' => string 'vacuum-cleaners' (length=15)
      'is_anchor' => string '1' (length=1)
  protected '_idFieldName' => string 'entity_id' (length=9)
  protected '_isDeleted' => boolean false
  protected '_oldFieldsMap' => 
    array (size=0)
      empty
  protected '_syncFieldsMap' => 
    array (size=0)
      empty
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:20:27+00:00Added an answer on May 28, 2026 at 1:20 am

    This is due to Magento lazy loading the category model. The getChildrenCategories() method on the Mage_Catalog_Model_Category model returns a collection of category models and Magento only loads the core model data rather than the additional EAV data for each model. The include_in_menu attribute is stored in the EAV data store and has not been loaded.

    Each category can be forced to load by calling $_category->load(); which will force Magento to load the additional EAV data for each category.

    // Loop through the categories
    foreach ($_sub_categories as $_category)
    {
        $_category->load();
        if ($_category->getIsActive() && $_category->getIncludeInMenu())
        {
            <echo navigation link>
        }
    }
    

    This changes the _data array from this:

    array (size=15)
      'entity_id' => string '16' (length=2)
      'entity_type_id' => string '3' (length=1)
      'attribute_set_id' => string '3' (length=1)
      'parent_id' => string '15' (length=2)
      'created_at' => string '2011-11-16 12:16:27' (length=19)
      'updated_at' => string '2011-12-19 16:19:08' (length=19)
      'path' => string '1/15/16' (length=7)
      'position' => string '1' (length=1)
      'level' => string '2' (length=1)
      'children_count' => string '8' (length=1)
      'is_active' => string '1' (length=1)
      'request_path' => null
      'name' => string 'Vacuum Cleaners' (length=15)
      'url_key' => string 'vacuum-cleaners' (length=15)
      'is_anchor' => string '1' (length=1)
    

    To this:

    array (size=33)
      'entity_id' => string '16' (length=2)
      'entity_type_id' => string '3' (length=1)
      'attribute_set_id' => string '3' (length=1)
      'parent_id' => string '15' (length=2)
      'created_at' => string '2011-11-16 12:16:27' (length=19)
      'updated_at' => string '2011-12-19 16:19:08' (length=19)
      'path' => string '1/15/16' (length=7)
      'position' => string '1' (length=1)
      'level' => string '2' (length=1)
      'children_count' => string '8' (length=1)
      'is_active' => string '1' (length=1)
      'request_path' => null
      'name' => string 'Vacuum Cleaners' (length=15)
      'url_key' => string 'vacuum-cleaners' (length=15)
      'is_anchor' => string '1' (length=1)
      'meta_title' => null
      'display_mode' => string 'PRODUCTS' (length=8)
      'custom_design' => null
      'page_layout' => null
      'url_path' => string 'vacuum-cleaners' (length=15)
      'image' => string 'heading_vacuums_1.png' (length=21)
      'include_in_menu' => string '1' (length=1)
      'landing_page' => null
      'custom_use_parent_settings' => string '0' (length=1)
      'custom_apply_to_products' => string '0' (length=1)
      'filter_price_range' => null
      'description' => null
      'meta_keywords' => null
      'meta_description' => null
      'custom_layout_update' => null
      'available_sort_by' => null
      'custom_design_from' => null
      'custom_design_to' => null
    

    Which includes the include_in_menu attribute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a custom Sharepoint 2010 activity which does some business logic, and at
I'm building some custom content types to capture customer data on a website. Admins
I'm building a custom UIView, which draws its own content in a drawRect: Method.
I am building custom activities, First activity is containing ReceiveSendReply activity with some other
Finally after struggling with extjs tree panel, tree store and building custom reader to
I have been building a custom control for some time now and overcome a
I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately,
I'm building custom content filtering system using custom radio buttons. There are some problems
I am trying to follow the examples from the documentation on building custom comparators
I asked a question about building custom Thread Safe Generic List now I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.