Displaying Metadata values from a File Content Type


When a new file is uploaded dotCMS extracts its metadata and indexes it for searches or to be displayed.

This sample shows how to take a list of file content types and display their metadata key values.


#foreach($con in $dotcontent.pull("+structureName:FileAsset",2,"modDate desc"))
File: $con.title
MetaData: $con.metaData
##Loop through all metadata field key, values
#foreach($md in $con.metaData.entrySet())
$md.key : $md.value
##Print each value separately:
Content type: $con.metaData.contentType
File Size: $con.metaData.fileSize