How to check in a PDF template if a field image is not empty?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Glasul Vietii
    Junior Member
    • Sep 2022
    • 4

    How to check in a PDF template if a field image is not empty?

    Hi, there

    We were wondering if you can help us with something?

    We try to check in a PDF Template if a field image is not empty than print that page with the person image


    Our code:

    {{#if personImage not empy}}

    {{imageTag personImageId}}

    {{/if}}

    personImage field is buletinMamaPoza


    We get this error:


    500 Internal Server Error

    Error in 'if&nbsp;</span><span style="color: rgb(51, 51, 51); background-color: var(--input-bg);">buletinMamaPoza not empy</span><span style="color: rgb(51, 51, 51); background-color: var(--input-bg);">': expect '"' but the token ended!! Wrong variable naming as 'if&nbsp;</span><span' in {{#if&nbsp;</span><span style="color: rgb(51, 51, 51); background-color: var(--input-bg);">buletinMamaPoza not empy</span><span style="color: rgb(51, 51, 51); background-color: var(--input-bg);">}} ! You should wrap ! " # % & ' * + , ; < = > { | } ~ into [ ] Unexpect token {{/if}} ! Previous token {{#[if&nbsp;<].[span><span]}} is not closed

    SO HOW TO CHECK IF AN IMAGE FIELD IS NOT EMPTY ?

    Thank you very much for your support!
    Attached Files
  • lazovic
    Super Moderator
    • Jan 2022
    • 810

    #2
    Hi Glasul Vietii,

    Please try this code:
    Code:
    {{#if buletinMamaPoza}}
    
    {{imageTag buletinMamaPozaId}}
    
    {{/if}}

    Comment

    Working...