Template Engine language reference > Composition Center interface > Document definition functions > propertyValue()

propertyValue()
This document definition function returns the value of a property. Depending on the context, use the following syntax:
$docdef.propertyValue(<propertyName>)
$docdef.<sectionName>.propertyValue(<propertyName>)
$docdef.<sectionName>.<resourceName>.propertyValue(<propertyName>)
You can use the propertyNameArray() function to get the property name. See propertyNameArray().
You can use this function to, for example, read the indentation and space properties defined in Composition Center. You can then use the retrieved values to specify the same indentation and space properties in the Template Engine template.
Example 66
Template
Value: $docdef.propertyValue('spaceafter')
Unit: $docdef.propertyValue('spaceafter.unit')
Output
Value: 14
Unit: pt
 
Example 67
Template
#set($resource=$docdef.section1.{Text A})
#foreach($propName in $resource.propertyNameArray())
$propName: $resource.propertyValue($propName)
#end
Output
spaceafter: 14
embeddedRuleId: 4028c01242db466801439ebaabc40017
RULETYPE: EMBEDDED
spaceafter.unit: pt
spacebefore.unit: pt
leftindent: 0
leftindent.unit: cm
spacebefore: 0
id: 4028c012-42db-4668-0143-9f04ce88008e
ruleId:
displayName:
name: Text A
description:
uri: strs://cc/res/1
 
Example 68
Template
#set($space=$docdef.propertyValue('spaceafter'))
#set($sunit=$docdef.propertyValue('spaceafter.unit'))
<html>
<head>
<style>
p {margin-bottom:$space$sunit;}
</style>
<title>MyTitle</title>
</head>
<body>
$docdef.section1.{Text A}
$docdef.section1.{Text B}
</body>
</html>
Output
<html>
<head>
<style>
p {margin-bottom:14pt;}
</style>
<title>MyTitle</title>
</head>
<body>
<p>Good morning ladies and gentlemen!</p>
<p>Good bye gentlemen and ladies!</p>
</body>
</html>
 
OpenText StreamServe 5.6.2 Updated: 2018-01-26