-
Notifications
You must be signed in to change notification settings - Fork 1.8k
button helper / printing with v3 beta? #858
Comments
With v3, you could easily create your own buttons - http://fancyapps.com/fancybox/3/docs/#faq |
Is that link supposed to actually go somewhere? |
Oh, sorry, I accidentally copied link from my local computer - http://fancyapps.com/fancybox/3/docs/#faq |
Purchased a license the other day for v3 - very nice I must add! I am trying to implement the custom download button example you show in the faqs and it doesn't seem to be working correctly. I am wondering if this has something to do with the structure of the link on my site :
That is an example from my page. I have a thumbnail of the image linked to the full size of the image. Without going into a ton of detail I am using showimage.php to show (and link to) images because they are dynamically pulled from a database and I do not want to show the true file location of the image. When I try to use the download button example what ends up happening is it just links to the image by itself when clicked rather than asking to download it - with none of the fancybox buttons, close, etc shown, but the overlay is still behind it. The only way to 'exit' out of this is to use the back button which goes back to the original page. Outside of the download button Fancybox works perfect with this example in every other way. If possible I would like to add this download button option to my users though. Any ideas? Is this because of the showimage.php method I am using as a link or something else? Any ideas how to get around this? |
If you wish, you can force file download -
|
Looks like I will have to do some custom work with this one when I have some time. I like idea #1, but will need to create another php script to specifically handle this case as that file is used for other things. I supposed in the custom button code I could figure out a way to pass the correct information to the other page then somehow.... I'll have to look at how the custom button coding works again. |
If I understand you correctly, you could just create links like "/showimage.php?show=capture22415.jpg&download=1" or simply "/showimage.php?download=capture22415.jpg". Then inside that php file just check the passed parameters to choose what headers to output. |
Yep, something like that. I would need to figure out how to write the custom button script though to do what I wanted. I don't have time right now, but it looks like you are just using api and callbacks for the one in your demo. I would just need to modify this to do what I needed it to (pull the correct link off the page and what not). I guess I could add in a 'data-download='downloadlink here'' or something on my pages then pull out that link in the script below with some modifications. I'll have to play around with it when I have time.
or better yet just append the &download=1 to the current links then I could use the same file and just modify the php to throw headers on download=true. |
I came across the v3 beta while searching about adding a print feature... does this have a print option included or not? I read this would be included in version 3. Does the 2.1 button helper work with this beta? I did not see it included in the beta zip.
The text was updated successfully, but these errors were encountered: