Get array from metadata schema


(Williamssp4) #1

Hi,

 

We have a metadata schema that includes checkboxes for categorising data records. Is there a keyword that we can use to return all keys/values in the array?

 

Note, we don't want to know which ones have been selected for a particular record, rather to return all possible values, so as to create a list of all possible options (regardless of whether any asset has them applied)

 

Hope this makes sense


(Anthony) #2

I havent tested, but something like %asset_attribute_select_options% seems about right. Evaluating that for the specific metadata schema field which you could either hardcode ( %globals_asset_attribute_select_options:12345% ) or use ^as_asset.

 

See manual page for all the attributes of metadata schema assets: http://manuals.matrix.squizsuite.net/metadata-schemas/appendices/asset-attributes

 

Anthony


(Williamssp4) #3

Hi,

Thanks for that... It doesn't seem to work though (at least, not if I put it directly in a Raw HTML block on a page).

Whereabouts would I need to use this?

 


(Anthony) #4

Can you post a screenshot showing how your metadata schema is set up?


(Williamssp4) #5

Screenshot attached -> it's #10013 we're trying to list the options of.

  metadata_schema.PNG (14.2 KB)


(Williamssp4) #6

The details of the options Settings itself... options.PNG (186 KB)


(Williamssp4) #7

anyone got any further ideas on this please?


(Bart Banda) #8

One trick I've done in the past to do this is to create an asset builder that uses that metadata schema for the asset to build. In the custom create layout, you then just print the keyword for that metadata select field, and nothing else. You can then access this by going %global_asset_contents_raw:1234% where 1234 is the id of you asset builder. This would bring you back the <select> field which you can then convert into arrays or whatever using JS. Not the prettiest solution I know, but the easiest that I've found.