We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    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
      follow me on twitter: @dimmy01
      • 4230
      • 28 Posts
      Quote from: kilroy at Sep 20, 2007, 02:21 AM

      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.

      Hello Kilroy,
      I’m glad that it works now. Praise the Lord.
      I think that I did include a template example in there, didn’t I? It is in the file called Print.template.php. Use that as an example.
      Could you give some of your combinations to check and see why they didn’t work?

      Thank you and God bless,
      AmazingDiscoveries.org
        • 4230
        • 28 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

        Hello Dimmy,
        That is a cool feature. I will maybe use it in the future. smiley
        Although I see some problems with it.
        - People don’t know about that feature, unless advertised but, most people would like to see what they print...
        - That is all done with CSS and my website is not all CSS so I couldn’t use it at the moment.
        - Beside that this snippet takes a little to install but works fine after; at least I think so.

        Thanks for the note!

        God bless,
        Amazing Discoveries
          • 7455
          • 2,204 Posts
          Its not that your snippet is not ok IT IS GREAT. and usable for another options also I think like creating a pdf from.
          I use print css allot because people like to print the page especially when its info like product info. then if a website is css and you print the page like you would print a page without a print link on the page itself. the printout looks horrible it will include the menu and other stuff not styled and not needed for the info the people want.

          you could use DOM to start the snippet when people try to print using the print option in there brouser or use ctrl+p or apple+p you could use "onbeforeprint" that way you could maybe run the snippet.

          Dimmy
            follow me on twitter: @dimmy01
            • 28033
            • 925 Posts
            Wouldn’t using a print CSS also include the navigation links / etc, since it’s just switching out CSS files?
              My Snippets
              -> PopUpChunk v1.0
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Not if you put display:none; for the containers you don’t want to print, like the div for your sidebar.

              http://www.alistapart.com/articles/goingtoprint/
                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
                • 7455
                • 2,204 Posts
                Quote from: Soshite at Sep 21, 2007, 12:44 PM

                Wouldn’t using a print CSS also include the navigation links / etc, since it’s just switching out CSS files?

                its not switching off its switching from screen css to print css try this link:
                http://www.esailing.nl/Bavaria-eSailing251.html

                the normal css is called like this:
                <link rel="stylesheet" href="blauw_details_css.html" type="text/css" media="screen" />
                <link rel="stylesheet" href="nav-en-vaste-opmaak_css.html" type="text/css" media="screen" />


                this is the print css: http://www.esailing.nl/Print-voor-detail-pagina.html
                and is called like this:

                <link rel="stylesheet" href="Print-voor-detail-pagina.html" type="text/css" media="print" />

                you see that i hide all the elements that I do not need for printing. and I added some hidden div’s to the page that i unhide for printing like contact information and disclaimer.

                Dimmy
                  follow me on twitter: @dimmy01
                  • 2327
                  • 214 Posts
                  A button of printing, generating a specific content, is different from the appeal to a print css

                  ... On the other hand, the media Print is still very limited in term of attributes in the standard css2 and raises full of problems!

                  This snippet is thus very well, without it does not seem valid xhtml. damage!
                    • 29158
                    • 7 Posts
                    Problem has been solved, I had just made a supid mistake.

                    Thank you for this Great Script!

                    Kind regards,
                    Pieter
                      • 28033
                      • 925 Posts
                      Is there a function that can be added to this to make it parse snippet code (instead of just displaying content)?

                      If not, then we’d need 1) a search+replace function to remove the snippet brackets and replace it with code to "hide" it (not that hard at all) and 2) something to output that no data could be printed.
                        My Snippets
                        -> PopUpChunk v1.0