pdf-template: Different head on first page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ulat
    Junior Member
    • Sep 2021
    • 21

    pdf-template: Different head on first page

    I use a cover page for quotes. Therefore I do want to print the header on the first page.

    Is this possible?

    I have tried it this way:

    ```

    {{#if [pageNumber > 1]}}

    Angebot Nr.: {{number}} / Seite: {pageNumber} von {totalPageNumber}

    {{/if}}​
    ```

    But this the the header is never printed....
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    #2
    Try with ifEqual

    Comment

    • ulat
      Junior Member
      • Sep 2021
      • 21

      #3
      Originally posted by shalmaxb
      Try with ifEqual
      No, does not work either...

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1602

        #4
        I think, you have to write

        {{#ifNotEqual pageNumber 1}} Angebot Nr.: {{number}} / Seite: {pageNumber} {{/ifNotEqual}}

        Comment

        • ulat
          Junior Member
          • Sep 2021
          • 21

          #5
          Originally posted by shalmaxb
          I think, you have to write

          {{#ifNotEqual pageNumber 1}} Angebot Nr.: {{number}} / Seite: {pageNumber} {{/ifNotEqual}}
          Yes, you are right. But I had just tried if my "if" would change anything. Even with the "ifNotEqual" the header will be printed on all pages..... I feel lost ;=)

          Comment

          • shalmaxb
            Senior Member
            • Mar 2015
            • 1602

            #6
            Did you write the condition in the code or in the WYSIWYG, did you escape the code by HTML comment (<!-- xxxxxx.-->)?

            Comment

            • ulat
              Junior Member
              • Sep 2021
              • 21

              #7
              Originally posted by shalmaxb
              Did you write the condition in the code or in the WYSIWYG, did you escape the code by HTML comment (<!-- xxxxxx.-->)?
              I have written the condition in the html code but without escaping it by comment. Yet the html-comment doesn't solve the problem either. Now I use this code but header is printed on all pages.

              HTML Code:
              <!--{{#ifNotEqual 1 pageNumber}}-->
              <p align="center"><span style="color: #205629; font-size: 10px;">Angebot Nr.:&nbsp; {{number}} / Seite: {pageNumber}&nbsp;von {totalPageNumber}</span></p>
              <!--{{/ifNotEqual}}-->

              Comment

              • shalmaxb
                Senior Member
                • Mar 2015
                • 1602

                #8
                {{#ifNotEqual 1 pageNumber}}​ must be {{#ifNotEqual pageNumber1}}

                Comment

                • ulat
                  Junior Member
                  • Sep 2021
                  • 21

                  #9
                  Originally posted by shalmaxb
                  {{#ifNotEqual 1 pageNumber}}​ must be {{#ifNotEqual pageNumber1}}
                  I have already tried both version - same behaviour. I have also tried to include the condition within brackets: [pageNumber 1].

                  Comment

                  • shalmaxb
                    Senior Member
                    • Mar 2015
                    • 1602

                    #10
                    Did you try to code the numder with ticks? {{#ifNotEqual pageNumber​ '1'}}
                    If that either does not work, I guess, that the system tag pageNumber might need an own custom handler to be used in the template.
                    Last edited by shalmaxb; 12-19-2023, 10:12 PM.

                    Comment

                    • yuri
                      Member
                      • Mar 2014
                      • 8440

                      #11
                      It's not possible.
                      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

                      • shalmaxb
                        Senior Member
                        • Mar 2015
                        • 1602

                        #12
                        As you cannot use the pageNumber Tag, what about to use another field for the condition, which only exists on page 1.

                        Comment

                        • yuri
                          Member
                          • Mar 2014
                          • 8440

                          #13
                          It will need having some token that changes its value to true. Not sure whether the helper interface does allow that except an entity attribute will be used as a token which is not elegant.
                          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...