v:iterator.explode
when used with the as
argument implies the variable assigned to as
is only available inside the tag content:
<v:iterator.explode content="1,2,3" as="numbers">
{numbers} is an array
</v:iterator.explode>
{numbers} is no longer defined.
This behaviour changed from VHS 1.7 to 1.8 (from memory).
Alternatively, do:
{artnumbers.qualitynumber.certificates
-> f:format.nl2br()
-> v:iterator.explode(glue: '<br />')
-> v:var.set(name: 'extractedCertificates')}
<f:for each="{extractedCertificates}" as="certificate">
{certificate}
</f:for>
Or better, but assumes your lines are ONLY separated by a single line break:
{artnumbers.qualitynumber.certificates
-> v:iterator.explode(glue: 'constant:LF')
-> v:var.set(name: 'extractedCertificates')}
<f:for each="{extractedCertificates}" as="certificate">
{certificate}
</f:for>
Which of course lets you skip the nl2br
step.
Even more compacted:
<f:for each="{artnumbers.qualitynumber.certificates -> v:iterator.explode(glue: 'constant:LF')}" as="certificate">
{certificate}
</f:for>