Back

Looping over the values of a Key Value field

Description

It can be hard to understand what is in a key value field.  The below code will loop over the values and spit out the keys and the values.

Code

#if ($UtilMethods.isSet($content.metaData))
    <h2>Metadata</h2>
		<table class="metadata">
		  #foreach($key in $content.metaData.entrySet())
			  #if($key.key != "map")
				<tr>
					<td>$key.key</td>
					<td>$key.value</td>
					</tr>
			  #end
		  #end
		</table>
  #end