Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1383
  • Last Modified:

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.
0
rafique12
Asked:
rafique12
  • 5
  • 2
1 Solution
 
Meir RivkinFull stack Software EngineerCommented:
0
 
rafique12Author Commented:
Thankyou, its is... sort of. I need to show category attribute instead of product attribute.
0
 
Meir RivkinFull stack Software EngineerCommented:
what is the type of the custom attribute?
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
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:
This solved my issue:

Mage::helper('catalog/output')->categoryAttribute(...)
0
 
rafique12Author Commented:
Had to look around but found it in the end. Thanks for the help anyway!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now