Add Values to a Sequence?

Vicky picture Vicky · Apr 1, 2011 · Viewed 38.9k times · Source

I've created a FreeMarker sequence in my template:

<#assign x = ["red", 16, "blue", "cyan"]>

How do I add additional values to the sequence?

Answer

Laurent Pireyn picture Laurent Pireyn · Apr 1, 2011

You have to create a new sequence by concatenating x and a sequence containing only the new element:

<#assign x = x + [ "green" ] />