Reputation: 328
I have a velocity template #foreach
loop that's not returning the expected properties from the object I'm trying to get them from: competitorAttributes
in the ppcThemeData object:
#set($ppcThemeData = {
"competitorAttributes": [
"Save up to 40%",
"Set price of $116",
"6 attractions from a choice of 9",
"3 predetermined attractions",
"Voucher by mail or print",
"Visit attractions for up to 9 days",
"No Hop-On Hop-Off bus tour"
]
}
})
The loop cycles through each property creating a list item. This loop, however, is not returning anything inside of the <ul>
. It is also not throwing any errors in the console and the page loads without any issues.
<ul>
#foreach($competitorAttribute in $pageTheme.competitorattributes)
#set($index = $velocityCount - 1)
<li><span>$competitorAttribute</span></li>
#end
</ul>
Upvotes: 0
Views: 449
Reputation: 328
$pageTheme.competitorattributes
needs to be: $pageTheme.competitorAttributes
- the A needs to be camel-case.
Upvotes: 0