I’ve created a website for a client where they would like to be able to allow folks to print recipes from their page.
1. Is there a way to have someone press a print button right above the “recipe” and it would open the system print dialog?
2. When I go to print the web site, hidden elements on the page actually show up in the printed version. Is there a certain way things need to be formatted to optimize for printing?
I created a Div and gave it the ID: Printable-Area. I formatted everything that I wanted to be printed in there. I then set the display to hidden so that it would not appear on my website.
Next, go to Project Settings / Custom Code and add this to the head of your Project:
Go to your page and add an HTML Embed Component where you want the button to appear and paste this code into it:
Print Article
create a text block anywhere and add the class print-area-button to it, then style your button how you want it to look, then delete the text block. You should see your button inside the Embed styled the way you want now.
Publish! Easy Peasy!
See it in action here:
Scroll to the bottom and you will see the button “Print Article”