We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42901 ☆ A M B ☆
    • 73 Posts
    Hi everybody,

    I'm looking for a way to build a pop-up coupon that a client can print out.
    We want the coupon to be editable using a TV (a simple one line text) that is passed to the coupon CHUNK.
    The coupon CHUNK has the background image, print command, and close window command along with where the text will be displayed.

    Our issue lies with printing the actual coupon, when we try to print it, the background image will not show up.

    If anyone has experience with this **OR** if someone knows how to make this, let me know. Our client needs this done and if I have to pay someone a small (please be small) fee, I'm not opposed to doing so.

    Thanks!
      Woodlands Ad Agency
      Our blog should NOT be read by anyone....EVER http://woodlandsadagency.com/blog/
      ...Don't say we didn't warn you.
      • 42046
      • 436 Posts
      Web print settings are usually defaulted to not print backgrounds. Try placing the background image in a div set to cover the entire body area instead.
        • 3749
        • 24,544 Posts
        What prints and what doesn't is usually determined by the CSS file.

        You add this in the head section:

        <link rel="stylesheet" href="print.css" type="text/css" media="print" />
        


        Then in print.css you make divs printable or not with

        display:block
        or
        display:none


        Here is a handy print button that will print the whole page:

        <div class="dontprint">
                <form><input type="button" value=" Print this coupon "
        onclick="window.print();return false;" /></form>
            </div>
        


        That class is specified in the print.css file as display:none; so the button itself won't be printed.

        There's and example here: http://bellands.com/fall-coupon.html

        You can do a "View Source" on it to see the HTML and click on the two CSS file links to see the CSS for the web page and the printed page.
          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
          • 36996
          • 211 Posts
            • 3109 ☆ A M B ☆
            • 894 Posts
            The easiest method is to put an image inside a div and insert the text absolute positioned on top of the image and print it.

            I made a sample page so you have a better idea on how to implement it download it here.

            Good Luck.
              Benjamin Marte
              Interactive Media Developer
              Follow Me on Twitter | Visit my site | Learn MODX