1

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!

Automagisch
  • 142
  • 11

2 Answers2

0

Turns out you have to call getValue('namespace') on $.siteConfig(), so it would be

$.siteConfig().getValue('namespace')

Would be cool to have the getValue method for site settings available on the global Mura Scope, so you would have the mura scope as the site layer, and use $.content() as the content layer. As in - it would make sense.

Automagisch
  • 142
  • 11
  • 1
    I understand what you're saying, but please understand the `$` is its own scope ... shorthand for the `mura` scope as you pointed out. It has several other 'subscopes' such as: `globalConfig()`, `siteConfig()`, `content()`, `currentUser()`, etc. – Steve Withington Jan 16 '15 at 16:08
0

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

  • Yes, thanks! It did work, still a mystery what happened yesterday but I think everything just points to a typo after all. Thanks very much! – Automagisch Jan 15 '15 at 15:03