Search code examples
coldfusionmura

Retrieving an extended attribute that extends Site/Default


I have a small problem using the Extended Attributes feature in Mura CMS. I have added a global extended attribute to Site/Default, but I am clueless how to retrieve it in my application. For normal content you would do $.content().getValue('namespace') but how does this work for an extended attribute within the site settings? I tried $.getValue('namespace') and $.siteConfig('namespace') but none worked.

thanks in advance!


Solution

  • As a Site/Default extended attribute, you should be able to access $.siteConfig('attName') ... so I would double check that it's not actually working. Maybe you accidentally typed the attributeName incorrectly?

    To access any attribute, including extended attributes, these should all work:

    $.siteConfig().getValue('attName')
    $.siteConfig().get('attName')  // <- in the latest version
    $.siteConfig('attName')
    

    This syntax should work on pretty much any bean within Mura CMS.

    Cheers, Steve