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

  • Home
  • SEARCH
  • 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 8756495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:05:41+00:00 2026-06-13T14:05:41+00:00

I have created a custom category attribute. Now i need to access it’s value

  • 0

I have created a custom category attribute.
Now i need to access it’s value in the _getHtml() function from Topmenu.php.

Can anyone tell me how to do this?:)

Any help is appreciated 🙂

  • 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-06-13T14:05:42+00:00Added an answer on June 13, 2026 at 2:05 pm

    You won’t be able to get that kind of data inside the TopMenu block, unless you make some changes.

    The Navigation is built up using a generic tree structure which doesn’t have an concept of what a category is, however this is built up elsewhere using the categories.

    If you look inside Topmenu.php you will see where the Navigation is built up:

    Mage::dispatchEvent('page_block_html_topmenu_gethtml_before', array(
        'menu' => $this->_menu
    ));
    

    This will fire off an event, which has an observer attached which will build up the navigation items for us, which happens to be:

    Model: Mage_Catalog_Model_Observer
    Method: _addCategoriesToMenu()
    

    You can then add your new attribute into the Node data, which will then be available inside Topmenu.php

    Example:

    $categoryData = array(
        'name' => $category->getName(),
        'id' => $nodeId,
        'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
        'is_active' => $this->_isActiveMenuCategory($category),
        'my_attribute' => $category->getData('my_attribute') // Add our data in...
    );
    

    You should then be able to use this inside Topmenu::_getHtml()

    echo $child->getData('my_attribute');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom post type calles articles and a custom category like
I have created custom attributes for a category in my module's install script like
I have created custom posts and I want one page in my site to
I have created custom jQuery UI widget called uiPopover, very similar to UI-dialog (in
I have created custom cell in which there are n number of image views.
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have created a custom post type named People. I have created a page
I have created a custom cell for loading into a table. The interface is
I have created a custom method that will return unique items, together with the
I have created a custom view with a XIB file and are loading the

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.