One more problem with pdf template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    One more problem with pdf template

    Ok, one problem solved, but another came up.
    I want to print a list of contact items and guess it is right to use #each for that. I looked into the documentation and there it says regarding #each that you must put the each helper in HTML-comment tags using the Code-View of the editor. I did so.

    But when I save and open again to edit, the comment tags are stripped. How can I make the template editor not to strip the tags?
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #2
    Hello,

    try to put all helper in html comment tag
    <!--...--> Tag

    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    • shalmaxb
      Senior Member
      • Mar 2015
      • 1602

      #3
      Hello,
      I did exactly that. But the embedded editor strips the comment tags and messes the rest of the tags. Tried to put them as &lt;....&gt;, also did not work. I searched about the whole day in everything about handlebars, tcpdf and even summernote (which is the embedded editor).
      I tried to find, where the HTML is stripped, without success. I don`t know if i missed any file, where this is configured, but I don`t think so.

      I wonder, if nobody uses that PDF function, because there are really few threads about that. The "manual" is ridiculous. Does explain quite nothing. I consider ESPOCRM a really good CRM and database tool, but it lacks of understandable and thorough manual. The most of the time you have to pass lots of trial and error, if you want to find solutions. And this problem I am facing here ist really a simple one (normally).

      I am quite frustrated.

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1602

        #4
        Nobody any idea?

        Comment

        • yuri
          Member
          • Mar 2014
          • 8440

          #5
          Putting "<!-- {{#each itemList}} -->" in Code View worked for me. It didn't strip anything.

          Can you provide your template code?
          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

            #6
            Code before saving:

            Code:
            <div><!--{{#each itemList}}-->
            {{lastName}}, {{firstName}} {{instrument}}
            <!--{{/each}}--></div>
            After saving:

            Code:
            <div>
            {{lastName}}, {{firstName}} {{instrument}} 
            </div>
            Same without the <div>.

            I don`t know, if it is important, but I am developing local on a Windows server stack (WAMP)..

            Comment

            • yuri
              Member
              • Mar 2014
              • 8440

              #7
              I could not reproduce it. What browser do you use?
              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

                #8
                normally I use Chrome, but tested also in Edge and Firefox with the same result.

                Comment

                • yuri
                  Member
                  • Mar 2014
                  • 8440

                  #9
                  Is this code is the only code you have? Could you confirm:

                  1. Create new template.
                  2. Switch Header field to Code View.
                  3. Paste the code.
                  4. Save.
                  5. Edit again.
                  6. Switch Header field to Code View.
                  7. Check whether {{#each}} is stripped.
                  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

                    #10
                    Did so. Unfortunately same result, comment tag and #each are stripped.

                    Comment

                    • yuri
                      Member
                      • Mar 2014
                      • 8440

                      #11
                      I have no clue. It's really weird. By 'code view' do you mean the button '</>' ?
                      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

                      • yuri
                        Member
                        • Mar 2014
                        • 8440

                        #12
                        Did you try without comment tags ? Comment tag is needed only when used inside <table> tags.

                        Code:
                        <div>
                        {{#each itemList}}  
                          {{lastName}}, {{firstName}} {{instrument}}
                        {{/each}}
                        </div>
                        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

                        • yuri
                          Member
                          • Mar 2014
                          • 8440

                          #13
                          I reproduced on another instance. Could be a bug of one of newest versions. I will check out.
                          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

                            #14
                            Yes, I mean "</> button.

                            Tried without comment tags, code was not stripped, but the PDF output was three blank pages for three records (which I selected from the list view to print a list)..

                            Comment

                            • shalmaxb
                              Senior Member
                              • Mar 2015
                              • 1602

                              #15
                              Thank you for your attention.

                              Comment

                              Working...