Learn how Scrivito CMS can help you deliver amazing digital experiences
See Scrivito CMS in action

get(name)

Retrieves the value of a metadata attribute.

image = Scrivito.getClass("Image").all().first(); metadata = image.get("blob").raw().metadata(); metadata.get('contentType');

Params

  • name (String) – The name of the metadata attribute.

Returns

String, Array<String>, Number or Date – metadata attribute value if found or null otherwise.

Example

imageObj = Scrivito.getClass("Image").all().first(); metadata = imageObj.get('blob').raw().metadata(); contentLength = metadata.get('contentLength'); height = metadata.get('height'); width = metadata.get('width'); console.log(`${width} x ${height}, ${contentLength} bytes`);