We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4230
    • 28 Posts
    This is an auto-generated support/comment thread for Print Documents.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    This snippet will add a print button which will put the document in a printable form.
      • 3953
      • 28 Posts
      Having problems with this snippet. See http://brianpedigo.com/resume.html. It is feeding the wrong URL (234.html) to the popup window by default. huh
        • 28033
        • 925 Posts
        Quote from: bpedigo at Aug 30, 2007, 03:02 PM

        Having problems with this snippet. See http://brianpedigo.com/resume.html. It is feeding the wrong URL (234.html) to the popup window by default. huh

        Look near the bottom of the snippet code. Change the URL ID to what the page’s ID is that you created.

        BTW, is there any way to allow this plugin to parse snippet code? Like for instance, on my homepage for my website --- I have a snippet that collects the forum posts made, and outputs them. But this snippet just shows the snippet call, and doesn’t parse the snippet.
          My Snippets
          -> PopUpChunk v1.0
          • 31837
          • 59 Posts
          nice work. smiley
            • 8883
            • 59 Posts
            @Soshite:
            How do you added pdfs? I want to do this too but generated automatically.
              • 3953
              • 28 Posts
              Quote from: endyzer at Sep 13, 2007, 06:43 AM

              @Soshite:
              How do you added pdfs? I want to do this too but generated automatically.

              I had to manually add my PDF.
                • 4230
                • 28 Posts
                Quote from: Soshite at Sep 02, 2007, 11:50 AM

                BTW, is there any way to allow this plugin to parse snippet code? Like for instance, on my homepage for my website --- I have a snippet that collects the forum posts made, and outputs them. But this snippet just shows the snippet call, and doesn’t parse the snippet.

                Hello Soshite,

                I’m going to check it out why it doesn’t parse them but it should...

                BTW, thanks for the help with the bug there. I’ll be resubmitting a new version.


                How do you added pdfs? I want to do this too but generated automatically.
                endyzer,
                I’m going to work on that later but at the moment I don’t have time. Maybe someone else can help. Thanks!

                God bless,
                AmazingDiscoveries.org
                  • 15877
                  • 55 Posts
                  I also have trouble getting this snippet to work at all.

                  Here is what I have done:

                  1. Created the snippet with the PrintDoc.snippet.php contents, called it PrintDoc.

                  2. Created a blank document (Called Print, ID 20). Pasted the following code in it [[PrintDoc? print_doc=`(20)` &tpl=`(Print)`]].

                  3. Used (blank) as a template for my Print document.

                  4. Created a chunk called Print and pasted the contents of Template.chunk.txt file.

                  5. Added the following code to the template where I wanted the print button to appear: [[PrintDoc? print_doc=`(20)`]]

                  This gives me a 404 as the print URL is not built properly in the Javascript link. I get this kind of link:
                  javascript:void window.open(’[~(20)~]&p_docid=3’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);

                  I then modified this line of the snippet code
                  $jslink = "javascript:void window.open(’[~$print_doc~]&p_docid=$modx->documentIdentifier’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);";
                  to
                  $jslink = "javascript:void window.open(’index.php?id=20&p_docid=$modx->documentIdentifier’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);";

                  This opens the popup window properly, but I get a "No documet Id set for the Printing page." message in it.
                    • 4230
                    • 28 Posts
                    Quote from: kilroy at Sep 19, 2007, 09:20 AM

                    2. Created a blank document (Called Print, ID 20). Pasted the following code in it [[PrintDoc? print_doc=`(20)` &tpl=`(Print)`]].

                    5. Added the following code to the template where I wanted the print button to appear: [[PrintDoc? print_doc=`(20)`]]

                    This gives me a 404 as the print URL is not built properly in the Javascript link. I get this kind of link:
                    javascript:void window.open(’[~(20)~]&p_docid=3’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);

                    I then modified this line of the snippet code
                    $jslink = "javascript:void window.open(’[~$print_doc~]&p_docid=$modx->documentIdentifier’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);";
                    to
                    $jslink = "javascript:void window.open(’index.php?id=20&p_docid=$modx->documentIdentifier’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);";

                    This opens the popup window properly, but I get a "No documet Id set for the Printing page." message in it.

                    Hello Kilroy,

                    I think that my instructions in the Snippet have confused you. I’m sorry about this.
                    There is nothing wrong with the snippet. You did everything right beside point 2 and point 5, then the changing of the snippet code. The problem is in the code you called the snippet with: [[PrintDoc? print_doc=`(20)` &tpl=`(Print)`]] should be: [[PrintDoc? &print_doc=`20` &tpl=`Print`]]. & was missing and the brackets () are not to be there. I added the brackets to say that this needs to be anumber or a name... Sorry.
                    Change the snippet back to what it was and, after replacing the above, it should work fine.

                    Thank you.
                    God bless,
                    AmazingDiscoveries.org
                      • 15877
                      • 55 Posts
                      Thank you for your help and reactivity.
                      It works fine now. smiley
                      I just need to create a template for my print page (as you did on your website).

                      Maybe you could add example codes to the snippet instructions to avoid this kind of mistake. I tried many combinations (with / without the first &, with / without brackets), but could not find the right one.