Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Open print dialogue box from button click?


TheNattyD

Question

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 post
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

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

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> $(

Posted Images

1 answer to this question

Recommended Posts

  • 0
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>

image.png.b348da2d01a22865e0b7a6ee34d173f2.png

Greeting, it's BaNgan from 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, 360 Degree Photo block, Seperator Block (SVG Shape divider for sections)
If 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 post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...