We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2327
    • 214 Posts
    I’m sorry but i have a problem with the install of this snippet :

    In my general template, i called the snippet like :

    [[PrintDoc? &print_doc=`Print`]]

    Where Print is the name (or Alias) to my print document.

    So, in my print document, I have this content :

    [[PrintDoc? &print_doc=`16` &tpl=`Print`]] and i have affect to him a specific template. But the problem is that the snippet called always the same document in the print window.

    What must i put in the &print_doc=`???????` for print the current document Id ?
      • 3749
      • 24,544 Posts
      Quote from: Dimmy at Sep 20, 2007, 02:49 AM

      why not just use a print css? we do this always see the product pages on this site:

      http://www.esailing.nl/Bavaria-eSailing251.html

      and try printing them.

      all done using css

      greets Dimmy

      Looks great, Dimmy (I wish I could afford the boat. I’ve chartered a Bavaria 34’ and it was a really sweet boat wink).

      Your print CSS does cut off the bottom of the ship name line (Bavaria 30 cruiser) and the two prices slightly (at least in IE6) but they’re still very readable.

      Bob


        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I ran across this, in reference to using a print css and content getting chopped off


        If you have an absolutely positioned element that extends longer than the length of the page, it will print preview and print correctly in every browser I tested on (Opera, IE, Safari, Camino) except for Firefox. Firefox will keep that absolutely positioned element on the first page and not let it bleed onto subsequent pages. The overflow element trick above does not correct this problem.

        To fix this, implement the following:

        <style type="text/css" media="print">
        .classname
        {
        position: relative;
        }
        </style>

        Therefore, when you print preview or print, the object will display properly and extend onto subsequent pages.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 2327
          • 214 Posts
          I’m sorry but i can’t resolve my problem with this snippet : The page called in the popup is always the same: It’s my first page.

          In my general template, i called the snippet like :

          [[PrintDoc? &print_doc=`19`]] where 19 is the Id of my Print Document.


          In my Print document (id=19), I pull this content :

          [[PrintDoc? &print_doc=`19` &tpl=`Print`]]

          And i added a chunk name Print, it contains :

          <table border="0" width="100%" align="center">
          <tr>
          <td align="left" style="padding-bottom: 5px"><div class="title">[*longtitle*]</div></td>
          </tr>
          <tr>
          <td align="left"><div style="font-size: 9px; padding-bottom: 20px; padding-left: 20px">[*description*]</div></td>
          </tr>
          <tr>
          <td>[+content+]</td>
          </tr>
          </table>




          Can someone help me to show the correct install for this snippet. I don’t understand why a chunk is required and how this snippet call the id of the current document in the popoup.

          Nothing functions for me. Thanks for your help

          Thank’s for your help.
            • 29076
            • 615 Posts
            As for now, the snippet only shows the content of the Print-document itself. Here is my data:

            In the template of the documents that is to be printed I put: [[PrintDoc? &print_doc=`348`]] where 348 is the ID of my Print-document.

            The Print-document (ID=348) contains: [[PrintDoc? &print_doc=`348` &tpl=`printTemplate`]].

            The template for templating the printout is called printTemplate and contains:
            <table border="0" width="100%" align="center">
            <tr>
            <td align="left" style="padding-bottom: 5px"><div class="title">[*pagetitle*]</div></td>
            </tr>
            <tr>
            <td align="left"><div style="font-size: 9px; padding-bottom: 20px; padding-left: 20px">[*description*]</div></td>
            </tr>
            <tr>
            <td>[*content*]</td>
            </tr>
            </table>

            But whatever I do the only document that shows up in the popup-window is the Print-document itself (ID=348). So far I can’t figure out whats wrong. Can someone of you that has this working properly Please post your data in the same way for us to compare?

            Thanks.
              I think, thererfor I am! But what I am, and why...?
              • 2327
              • 214 Posts
              Yes,it seem the process to install this snippet is not evident for someone...Isnt’it ?
                • 3749
                • 24,544 Posts
                You might try this:

                [[PrintDoc &print_doc=[+id+]  ]]


                to print the current document, although I think the snippet could (should?) be written to do this automatically if there is no &print_doc parameter.

                Bob
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 29076
                  • 615 Posts
                  Hm, I have tried every thing you guys said here, but for me it doesn’t work at all. The snippet only shows the print-document it self, whatever I do. huh

                  It would be wery nice if someone could lend an eye over to this and see if there could be some improvements to the snippet itself.
                    I think, thererfor I am! But what I am, and why...?
                    • 3749
                    • 24,544 Posts
                    Quote from: Sylvaticus at Jan 07, 2008, 12:43 PM

                    Hm, I have tried every thing you guys said here, but for me it doesn’t work at all. The snippet only shows the print-document it self, whatever I do. huh

                    It would be wery nice if someone could lend an eye over to this and see if there could be some improvements to the snippet itself.

                    Sorry that didn’t work. I’m afraid I’m just guessing at solutions because I don’t use the snippet myself. I use a dedicated print .css file to control what’s printed and put a javascript "Print this page" button on the page.

                    Bob
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 29076
                      • 615 Posts
                      Quote from: BobRay at Jan 08, 2008, 08:06 PM
                      I use a dedicated print .css file to control what’s printed and put a javascript "Print this page" button on the page.

                      That became my solution as well. smiley
                        I think, thererfor I am! But what I am, and why...?