bhupen
11 years agoAdvisor
how can setup default value in ftl?
Hi,
Iam getting following error:
the following has evaluated to null or missing: ==> link [in template "preview" at line 145, column 55] Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>
But Iam not sure how can I setup default value for this. I have the following code where Iam getting this value using FTL:
<#assign link = notification.target.entity.@view_href />
<a href="${link}">
<h4>${notification.target.actor.login?string},
${text.format('pdc6.notifications.mentioned_string')},
${subject?string}</h4>
<div class="details">
<b class="notification-icon mono-icons-bg notification-mention"></b> ${date}
</div>
</a>