Show custom category attribute in Frontend Magento

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.
rafique12Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
rafique12Connect With a Mentor Author Commented:
This solved my issue:

Mage::helper('catalog/output')->categoryAttribute(...)
0
 
Meir RivkinFull stack Software EngineerCommented:
0
 
rafique12Author Commented:
Thankyou, its is... sort of. I need to show category attribute instead of product attribute.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Meir RivkinFull stack Software EngineerCommented:
what is the type of the custom attribute?
0
 
rafique12Author Commented:
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

0
 
rafique12Author Commented:
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?!?!?!
0
 
rafique12Author Commented:
Had to look around but found it in the end. Thanks for the help anyway!
0
All Courses

From novice to tech pro — start learning today.