You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by "Ondra Žižka (JIRA)" <ji...@apache.org> on 2017/10/02 04:42:02 UTC

[jira] [Created] (FREEMARKER-79) Introduce <#continue> to skip an item within <#list>

Ondra Žižka created FREEMARKER-79:
-------------------------------------

             Summary: Introduce <#continue> to skip an item within <#list>
                 Key: FREEMARKER-79
                 URL: https://issues.apache.org/jira/browse/FREEMARKER-79
             Project: Apache Freemarker
          Issue Type: New Feature
          Components: engine
    Affects Versions: 2.3.26-incubating
            Reporter: Ondra Žižka


Freemarker has {{<#break>}} but no {{<#continue>}} to skip items in a {{<#list>}}.

It has been considered few times, but seems it's not here in Apache Jira, so I'm adding it.

Copying the reasoning from old FM feature request [https://sourceforge.net/p/freemarker/feature-requests/79/]


{quote}
In Freemarker you can use break directive to exit from a list loop: actually I would need a "continue" directive to go to the next item if some condition is verified.
EG:
<#assign seq = ["winter", "spring", "summer", "autumn"]>
<#list seq as x>
<#if x = "spring"><#continue></#if>
${x}
</#list>
This will simply not print spring skipping directly to next item.
{quote}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)