#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- FreeMarker samples -->
<#import "lib-datetime.ftl" as dt>
<#import "lib-string.ftl" as str>
${title}
<@widget name="test" />
${i18n().dates}
- ${i18n().current_date_time} ${.now?datetime}
- ${i18n().current_date} ${.now?date}
- ${i18n().current_time} ${.now?time}
${i18n().formatted_date_time}
${dt.xsdDateTimeToYear(xsddatetime)}
${i18n().apples}
<#list apples as apple>
- ${apple}
#list>
${i18n().fruit}
<#list fruit as f>
- ${f}
#list>
${i18n().animal} ${animal}
${i18n().book_title} ${bookTitle}
${i18n().zoo_one}
<#list zoo1.animals as animal>
- ${animal}
#list>
${i18n().zoo_two}
<#list zoo2.animals as animal>
- ${animal}
#list>
${i18n().berries} ${berries}
${year?number?c}
${i18n().raw_string_literals}
${r"#{title}"}
${r"${title}"}
${i18n().containers_do_not_pick_up_changes}
<#assign
fruit = ["apples", "oranges", "bananas"]
veg = ["beans", "peas", "carrots"]
food = [fruit, veg]
fruit = fruit + ["pears"]
>
<#noparse>
<#assign
fruit = ["apples", "oranges", "bananas"]
veg = ["beans", "peas", "carrots"]
food = [fruit, veg]
fruit = fruit + ["pears"]
>
#noparse>
${i18n().list_elements_of} ${r"${fruit}"}
<#list fruit as f>
${f}
#list>
${i18n().list_elements_of} ${r"${food}"}: ${i18n().contains_no_pears}
<#list food as item>
<#list item as i>
${i}
#list>
#list>
${i18n().numbers}
<#assign
one = 1
two = 2
numbers = [one, two]
two = 20
numbers2 = [one, two]
>
<#noparse>
<#assign
one = 1
two = 2
numbers = [one, two]
two = 20
numbers2 = [one, two]
>
#noparse>
${r"${two}"}: ${two}
${r"${numbers[1]}"}: ${numbers[1]}
${r"${numbers2[1]}"}: ${numbers2[1]}
${i18n().undo_camelcasing}
<#assign s1 = "FreemarkerTest">
${s1} => ${str.unCamelCase(s1)}
<#assign s2 = "Freemarker">
${s2} => ${str.unCamelCase(s2)}
<@dump var="now" />
<@dump var="urls" />
<@dump var="fruit" />
<@dump var="trueStatement" />
<@dump var="zoo1" />
${scripts.add('',
'',
'')}
<@dumpAll />
<@help for="dump" />
<@help for="profileUrl" />