tisdag 17 augusti 2010

Readable Freemarker code with <#compress>

In Freemarker the use of compress-tag can make the code more readable since you are allowed to use extra rows for grouping code blocks without having the rows presented on the layout.

From Freemarker manual as follows:

<#assign x = "    moo  \n\n   ">
(<#compress>
1 2 3 4 5
${moo}
test only

I said, test only

<#compress>
)

will output

(1 2 3 4 5
moo
test only
I said, test only)

http://freemarker.sourceforge.net/docs/ref_directive_compress.html

1 kommentar: