tidbit for today: if you would like to prefix (or ...
# advancedpdf
d
tidbit for today: if you would like to prefix (or suffix) some field with text, but only if it has content, normally you'd write something like:
<#if record.field?has_content>prefix: ${record.field}</#if>
or
${record.field?has_content?then('prefix: '+record.field,'')}
you can leverage the string built-in ?ensure_starts_with/?ensure_ends_with with a regexp pattern instead:
${record.field?ensure_starts_with('^$','prefix: ')
🥰 1
(was using this within a macro call so couldn't use
<#if>
)