Guest Posted February 28, 2021 Share Posted February 28, 2021 Site URL: https://amalfimedia.com/nfc/moroccan-stew Hello, all! I was wondering if anyone knows how to use the window.print() method to a Squarespace button? I’d like for people to have the option to print our recipes without having to send them to a service like printfriendly. I feel like this could be done with markdown or code but I’d really like if it was in a button like the other 3 on the page. Thanks so much! Link to comment
Beyondspace Posted March 1, 2021 Share Posted March 1, 2021 16 hours ago, TheNattyD said: Site URL: https://amalfimedia.com/nfc/moroccan-stew Hello, all! I was wondering if anyone knows how to use the window.print() method to a Squarespace button? I’d like for people to have the option to print our recipes without having to send them to a service like printfriendly. I feel like this could be done with markdown or code but I’d really like if it was in a button like the other 3 on the page. Thanks so much! You gonna need 2 steps to achieve this 1. Add a button with link, something like: "#print-page" 2. Head to Settings->Advanced->Code Inject, paste this to footer <script> $(document).ready(function() { $(document).on("click", "#block-yui_3_17_2_1_1614500466691_13651 .sqs-block-button-element[href='#print-page']", function(e) { e.preventDefault(); window.print() return false; }) }); </script> BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.