User Tools

Site Tools


en:public:developer:template_system:tags:string:datacache

This is an old revision of the document!


<#datacache>

Use this tag to cache data in memory.

Parameters

Name Mandatory Description
Id Yes The key to use to store/retrieve the content
content Yes content to cache in memory
validity Yes Expiration time in seconds, 0 mean no delay, if validity is superior to 30 days, engine will use it as a UNIX timestamps for expiration

Literal

<#datacache id=”..” validity=”…”>..content..<#endsection>

Example

<#datacache id="footer_POPULARAREAS_geoplaces|<#language>|<#Url_Transac_Kind default=0>|<#Url_Property_Subcategory default=0>" validity="604800">
            <#{geoplaces>
 
              <#{GeoPlaceRequest.skip><#random Range=450><#}GeoPlaceRequest.skip>
 
              <#{GeoPlaceRequest.First>50<#}GeoPlaceRequest.First>
 
              <#{GeoPlaceRequest.ID_indirect_parent_geoplace><#IF condition="<#language lowercase=1 checksum=1> <> 'usa'"><#language ISO3166=1><#endif><#}GeoPlaceRequest.ID_indirect_parent_geoplace>
 
              <#{GeoPlaceRequest.OrderBy>
                <#IF condition="<#Url_Transac_Kind default=0> = 5">
                  nb_ad_newconstruction_DESC
                <#elseIF condition="<#Url_Transac_Kind default=0> = 4">
                  nb_ad_equityrelease_DESC
                <#elseIF condition="<#Url_Transac_Kind default=0> = 2">
                  <#IF condition="<#Url_Property_Subcategory default=0> = 2">  
                    nb_ad_com_forrent_DESC
                  <#else>
                    nb_ad_res_forrent_DESC
                  <#endif>
                <#elseIF condition="<#Url_Transac_Kind default=0> = 3">
                  nb_ad_vacationrentals_DESC
                <#else>
                  <#IF condition="<#Url_Property_Subcategory default=0> = 2">  
                    nb_ad_com_forsale_DESC
                  <#else>
                    nb_ad_res_forsale_DESC
                  <#endif>                
                <#endif>              
              <#}GeoPlaceRequest.OrderBy>
 
              <#{template>
 
                <#if condition="<#Url_Transac_Kind checksum=1> = 0"><#_footer_POPULARAREAS_Transaction_type setValue="1"><#else><#_footer_POPULARAREAS_Transaction_type setValue="<#Url_Transac_Kind>"><#endif>
                <#if condition="<#Url_Property_SubCategory checksum=1> = 0"><#_footer_POPULARAREAS_Property_SubCategory setValue="1"><#else><#_footer_POPULARAREAS_Property_SubCategory setValue="<#Url_Property_SubCategory>"><#endif>
 
                <#for var="i" from="0" to="<#geoplaces.count> - 1">
                  <a href="<#url id="PropertyListings"
                                 PropertyListings_Type="1"
                                 Output_Format="1"
                                 GeoPlace_ID="<#geoplaces[<#i>].id>"
                                 GeoPlace_URL="<#geoplaces[<#i>].Translations[<#language>].label_url>"
                                 GeoPlace_HaveChilds="<#geoplaces[<#i>].haveChilds>"
                                 PageNumber="1"
                                 Transac_Kind="<#_footer_POPULARAREAS_Transaction_type>"
                                 Property_Category="<#Url_Property_Category>"
                                 Property_SubCategory="<#_footer_POPULARAREAS_Property_SubCategory>"
                                 Property_Kind="<#Url_Property_Kind>"
                                 xmlencode="1">"><#geoplaces[<#i>].Translations[<#language>].label xmlencode=1></a><#if condition="(<#i> < <#geoplaces.count> - 1)">&nbsp;-<#endif>
                <#endfor>
 
              <#}template>
 
            <#}geoplaces>          
          <#enddatacache>
 

The above example will output:

<html>
  <head>
    This must be in the header
  </head>
  <body>
  </body>  
</html>
en/public/developer/template_system/tags/string/datacache.1367494783.txt.gz · Last modified: 2013/05/02 15:39 by svanderclock