1

I've created a class extension (drop-down list of color names), and I want to display a custom attribute called "deptHomeCol2Color" in a page layout that I've created.

According to the Mura documentation:

#$.content('deptHomeCol2Color')#

is all I should need. However, this is not outputting anything, even though I've selected a value for it in my Extended Attributes on the page (where this custom attribute is showing). What am I doing wrong here?

The page isn't throwing an error, and I've verified that a color was selected on the page itself.

JesseEarley
  • 1,036
  • 9
  • 20
  • Where did you define your class extension (what base type)? What version of Mura are you running? Where is the ColdFusion template located that you are trying to output this variable? – Miguel-F Apr 13 '17 at 13:56
  • Try to show all the available attributes on a content item, and their values, including extended attributes. – m_evangelista Apr 14 '17 at 12:25

1 Answers1

2

@JesseEarly, you are correct in using $.content('attributeName') ... but that's specifically for "content" class extensions. Did you create a "site" class extension? If so, you should use $.siteConfig('attributeName').

Also, if a requested attribute isn't found, Mura will simply return an empty string. This sometimes happens to me when I accidentally type the attribute name incorrectly. I would double check both the actual attribute name itself in the class extension, and match it to the one you're using in your code. Sometimes, my typo occurred while creating the attribute, and then correctly spelled it in my code.

Hope that helps! -Steve