Announcement

Collapse
No announcement yet.

One more problem with pdf template

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

  • 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?

  • #2
    Hello,

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

    Comment


    • #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


      • #4
        Nobody any idea?

        Comment


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

          Can you provide your template code?

          Comment


          • #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


            • #7
              I could not reproduce it. What browser do you use?

              Comment


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

                Comment


                • #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.

                  Comment


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

                    Comment


                    • #11
                      I have no clue. It's really weird. By 'code view' do you mean the button '</>' ?

                      Comment


                      • #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>

                        Comment


                        • #13
                          I reproduced on another instance. Could be a bug of one of newest versions. I will check out.

                          Comment


                          • #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


                            • #15
                              Thank you for your attention.

                              Comment

                              Working...
                              X