TheNattyD 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! Beyondspace 1 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> tuanphan 1 Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment