AnsweredAssumed Answered

SOLVED FreeMarker neasted value :(

Question asked by joksy on Apr 17, 2009
Latest reply on Apr 17, 2009 by joksy
HI to everybody,

I m new to this templating language, and of course it easy encounter some problem.
Ok I post the piece of code,


<#assign Months = {"Gennaio":"01"}+{"Febbraio":"02"}+{"Marzo":"03"}+{"Aprile":"04"}+{"Maggio":"05"}
+{"Giugno":"06"}+{"Luglio":"07"}+{"Agosto":"08"}+{"Settembre":"09"}+{"Ottobre":"10"}+{"Novembre":"11"}
+{"Dicembre":"12"}>


<p style="margin-left:35%; font-size:14px; "> Emissioni di oggi: ${date?string("d MM yyyy")}</p>

<#if companyhome.childByNamePath["Emissioni"]?exists>

<#list companyhome.childByNamePath["Emissioni"].children as x>

<#list x.children as y>
<#assign name_month = y.properties.name>
   
   ${Months.${name_month}?string}
   ${y.properties.name}<br>
   
<#list y.children as doc>
   ${doc.properties["cm:created"]?date?string("d MM yyyy")}<br>
   ${date?string("d MM yyyy")}
   
   <#if doc.properties["cm:created"]?date?string("d MM yyyy") = date?string("d MM yyyy")>
      are equals : ${doc.properties.name} <br>
      <#if doc.properties["{http://www.xxx.com/model/content/1.0}Tema']?exists>
         Tema dell emissione: ${doc.properties["{http://www.xxx.com/model/content/1.0}Tema"]}
      </#if>
   <#else>
      are not equals : ${doc.properties.name} <br>
      
   </#if>      
   
   
</#list>
</#list>
</#list>

</#if>



The problem araise when i m try to get the value of another assignation for get from the hash the value ,

<#assign name_month = y.properties.name>
   
   ${Months.${name_month}?string}

The previous attempts was, but simply tell me that Months.name_moth does not exist, and of course is true. so can i solve this situation.

<#assign name_month = y.properties.name>
   
   ${Months.name_month}


Thanks a lot

Best Regards

Outcomes