Page properties not producing output
I'm trying to get data from page properties into a data- attribute in the HTML, so I can access the data from front-end code. I've tried two styles of property name -- one "bare" name defaultTitle and one with a dot to help organize it, contact.defaultTitle -- and two styles of access, referencing properties and inheritedPageProperties. I've authored both properties and verified the keys & values in the JCR.
When I use data-sly-list to loop over both the properties and inheritedPageProperties, I see all the properties I expect, including my two title props.
But when I try to refer to the properties directly -- in an HTML attribute, or as the content of an HTML element -- only one of the four styles produces output. Why?
Markup:
<div class="get-in-touch-form"
data-default-titleIPropDef="inheritedPageProperties.defaultTitle: ${inheritedPageProperties.defaultTitle}"
data-default-titleIPropContactDef="inheritedPageProperties.contact.defaultTitle: ${inheritedPageProperties.contact.defaultTitle}"
data-default-titlePropDef="properties.defaultTitle: ${properties.defaultTitle}"
data-default-titlePropContactDef="properties.contact.defaultTitle: ${properties.contact.defaultTitle}"
>
<pre>
'defaultTitle'
iprop default: ${inheritedPageProperties.defaultTitle}
prop default: ${properties.defaultTitle}
'contact.defaultTitle'
iprop default: ${inheritedPageProperties.contact.defaultTitle}
prop default: ${properties.contact.defaultTitle}
</pre>
<h3>inheritedPageProperties</h3>
<ul data-sly-list.iprop="${inheritedPageProperties}">
<li>iprop ${iprop} - ${inheritedPageProperties[iprop]} ;</li>
</ul>
<h3>properties</h3>
<ul data-sly-list.prop="${inheritedPageProperties}">
<li>prop ${prop} - ${inheritedPageProperties[prop]} ;</li>
</ul>
Output (I removed all the properties produced by the loop except the ones in question; the entire list of properties renders correctly):
<div class="get-in-touch-form"
data-default-titleIPropDef="inheritedPageProperties.defaultTitle: Winnie the Pooh" <-- OK
data-default-titleIPropContactDef="inheritedPageProperties.contact.defaultTitle: " <-- MISSING
data-default-titlePropDef="properties.defaultTitle: " <-- MISSING
data-default-titlePropContactDef="properties.contact.defaultTitle: " <-- MISSING
data-page-title="WorkLife at Irvine Towers®" foo="bar">
<pre>
'defaultTitle'
iprop default: Winnie the Pooh <-- OK
prop default: <-- MISSING
'contact.defaultTitle'
iprop default: <-- MISSING
prop default: <-- MISSING
</pre>
<h3>inheritedPageProperties</h3>
<ul>
<li>iprop defaultTitle - Winnie the Pooh ;</li> <-- OK
<li>iprop contact.defaultTitle - And Tigger, Too! ;</li> <-- OK
</ul>
<h3>properties</h3>
<ul>
<li>prop defaultTitle - Winnie the Pooh ;</li> <-- OK
<li>prop contact.defaultTitle - And Tigger, Too! ;</li>. <-- OK
</ul>