Conditional Header Image changing in PDF template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashif Malayil
    Senior Member
    • Dec 2023
    • 213

    #1

    Conditional Header Image changing in PDF template

    Is it possible to change the header image dynamically using a condition like the one below in the PDF template header code section?


    {if bank.paymentMethod == 'PayNova' || cCInstallments.paymentGateway == 'TransactFlow'}
    <p style="text-align: center;">
    <img src="?entryPoint=attachment&id=1234564789" style="width:619.656px;">
    </p>
    {elseif bank.paymentMethod == 'SecurePayX' || cCInstallments.paymentGateway == 'QucickGate'}
    <p style="text-align: center;">
    <img src="?entryPoint=attachment&id=123454321" style="width:619.656px;">
    </p>
    {elseif bank.paymentMethod == 'PayPulse' || cCInstallments.paymentGateway == 'AUF Bank'}
    <p style="text-align: center;">
    <img src="?entryPoint=attachment&id=123412340" style="width:619.656px;">
    </p>
    {/if}
  • yuri
    Member
    • Mar 2014
    • 9157

    #2
    Hi,

    I recommend to use the x-if attribute for conditions. It's also possible to have nested logical operation helpers.

    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...