Announcement

Collapse
No announcement yet.

Assistance Needed: Conditional Text Display in PDF Templates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Assistance Needed: Conditional Text Display in PDF Templates

    I have a field checklist with multiple options, such as "Compliance" and "Changes in Deadline." I'm trying to generate a PDF from PDF templates and need help with displaying text based on certain conditions.

    For example, I have a text statement: "The Company will comply with all necessary rules and regulations while providing the services." I want this text to be displayed in the PDF only if the "Compliance" option is enabled in the checklist. Otherwise, the text should be hidden.

    Could you please help me with how to check this condition and show or hide the text accordingly in the PDF template?

  • #2
    Click image for larger version

Name:	image.png
Views:	90
Size:	29.8 KB
ID:	108672​checklist

    Comment


    • #3
      see here: https://forum.espocrm.com/forum/gene...ld-checkboxtag

      Comment


      • #4
        shalmaxb

        {{#if checkboxTag fieldName option='Compliance'}}
        <li><b>Responsibility Post-Release:</b> Once the original documents and credentials (username and password) are released to the Customer, the Company does not hold any responsibility for future misuse or security breaches. The Customer is responsible for keeping these credentials confidential and secure. Any misuse or changes made by third parties will be the Customer's responsibility.</li>
        {{/if}}


        i tried this but it doesnt work

        Comment


        • shalmaxb
          shalmaxb commented
          Editing a comment
          where in your formula is written "fieldName" you have to put "cTermsAndCondition"

      • #5
        {{#if checkboxTag cTermsAndCondition option='Compliance'}}
        <li><b>Responsibility Post-Release:</b> Once the original documents and credentials (username and password) are released to the Customer, the Company does not hold any responsibility for future misuse or security breaches. The Customer is responsible for keeping these credentials confidential and secure. Any misuse or changes made by third parties will be the Customer's responsibility.</li>
        {{/if}}​

        tried this still not working

        Comment


        • #6
          from the example in thread #3 I think, you do not need the if-Tag at all, put only every condition in a line of itself.

          Comment


          • #7
            it will show like this checkbox at the end of text
            Click image for larger version

Name:	image.png
Views:	91
Size:	28.5 KB
ID:	108680

            Comment


            • #8
              yuri please help

              Comment


              • #9
                Hi,
                can be a idea but your sample must so i think : i just move the {{/if}}
                I think it's more html issue because after checkbox, you have a <li> ... i think the checkboxTag must go after the <li> and before the <b>

                PHP Code:
                {{#if checkboxTag cTermsAndCondition option='Compliance'}}{{/if}}
                <li><b>Responsibility Post-Release:</bOnce the original documents and credentials (username and passwordare released to the Customerthe Company does not hold any responsibility for future misuse or security breachesThe Customer is responsible for keeping these credentials confidential and secureAny misuse or changes made by third parties will be the Customer's responsibility.</li>
                ​​ 

                Comment

                Working...
                X