Get Custom Attribute Value within Autonav Block
Permalink 3 users found helpful
I have a custom attribute on some pages called 'navDescription' and want to use the value in that attribute's field as part of an Autonav template.
What do I need to add to the autonav template? I'm guessing it is something along the lines of:
but I'm getting the error "Fatal error: Call to undefined method stdClass::getAttribute()." Please help!
What do I need to add to the autonav template? I'm guessing it is something along the lines of:
foreach ($navItems as $ni){ $customAttribute = $ni->getAttribute('navDescription'); echo $customAttribute; }
but I'm getting the error "Fatal error: Call to undefined method stdClass::getAttribute()." Please help!
Thanks for posting your solution. I came across it when I was trying to create an auto nav with a dead link. I needed the parent of a set of nav items to be displayed but not go anywhere when clicked. I can now have my autonav check a custom attribute to see if its link should be included. Thanks again.
Cheers,
C
Cheers,
C
I'm glad this was of assistance to you!
Here is what I ended up doing: