User Tools

Site Tools


en:public:developer:template_system:tags:miscellaneous:tlookupvalues:create

This is an old revision of the document!


<#Tlookupvalues.create>

Lookup values lists are the lists with all the actual string values on different languages using on Arkadia. For example, these lists contain all language versions of property categories, currency codes, types of invoices, also the different resource strings like captions, labels, button titles and other.

Lookup lists provide the good way to internationalize the web-site. They contain also the most required lists for the work of web-site like geographical places, property categories etc.

How it looks like?

Common lookup values list is connected with some table in database. For example, lookup values list with resource strings is connected with the table “RESOURCE_STRING” and uses all the data from the rows of this table. Physically lookup list looks like array of TStringList indexed by their ID and language.

<#lookupvalues>

The function <#lookupvalues> is intended to return any lookup list and output its data to the page. The syntax to use this function is typical array syntax:

<#lookupvalues[const_lookuplists_resourcestrings][usa]>

It references to the TALStringList with all the english values of lookup list with id defined by the const “const_lookuplists_resourcestring” (you can find complete list of the IDs below).

Then you can use the content of this list by the same way as you use content of plain TALStringList. Few common examples:

1. I want to print count of the elements in the list

<#lookupvalues[const_lookuplists_resourcestrings][usa].count>

2. I need to scroll all the list and print each value

<#for var="i" from="0" to="<#lookupvalues[const_lookuplists_civility][usa].count> - 1">
  <#lookupvalues[const_lookuplists_civility][usa].valuefromindex[<#i>]>
<#endfor>

This will output the content of lookup list with all the civilities.

Mr
Ms
Mrs

List of IDs of lookup lists

In process.

en/public/developer/template_system/tags/miscellaneous/tlookupvalues/create.1380098096.txt.gz · Last modified: 2013/09/25 12:34 by svanderclock