Show custom category attribute in Frontend Magento

Posted on 2013-01-16
Last Modified: 2016-03-02
I've added an attribute text field in Magento category admin page.

I'm trying to echo the value fromtend using this code:

<?php echo $_category->getMyAttribute() ?>

Open in new window

but its not visible. Is there a better way of doing this? I've checked the database under
EAV_attribute table and can see that it has been update and the text field is showing in the backend.
Question by:rafique12
  • 5
  • 2
LVL 42

Expert Comment

ID: 38782453

Author Comment

ID: 38782669
Thankyou, its is... sort of. I need to show category attribute instead of product attribute.
LVL 42

Expert Comment

ID: 38782846
what is the type of the custom attribute?
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.


Author Comment

ID: 38783016
Its a text field. I've called it nav_description as I want to show a short description under category navigation links on the frontpage.

<?php echo $_category->getNavDescription() ?>

Open in new window


Author Comment

ID: 38792737
There must be someone that knows how to do this?

I've tried almost every method but none allow me to display the value of a custom category attribute on the front end.

I've created a module made sure the EAV attribute has been updated with my new attribute. it is also showing in the backend but nothing in the front?!?!?!

Accepted Solution

rafique12 earned 0 total points
ID: 38839427
This solved my issue:


Author Closing Comment

ID: 38854276
Had to look around but found it in the end. Thanks for the help anyway!

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP Curl to output a url 7 48
Ajax and PHP 4 31
PHP 5.6 and 7.x 4 23
php date function ( diffrence between two dates ) 6 16
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question