Question about a lightbox option

  • 1
  • Question
  • Updated 7 years ago
  • Answered
Hello, I've recently discovered Yola and I have to say this is a great service I will recommend to some friends. I came here to ask for help because I can't seem to find the answer by myself.

I really like the basic widget that allows us to display pictures. It opens a nice lightbox, but I wondered, would it be possible to add a download link next to the "close lightbox" button? There are many sites using jQuery that also have this neat option. I understand there is no option for this in the gallery widget panel (where we set the gallery), but I wouldn't mind a piece of code to add manually on each page, if that could serve the purpose.

If you want to see what I'm talking about, I have found a website where this kind of option is, on the lightbox, next to "close", see here: http://game.hgo.se/blog/motion-capture/

Thanks for your time and for this nice service you offer.
Photo of BadDog

BadDog

  • 7 Posts
  • 0 Reply Likes

Posted 7 years ago

  • 1
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello BadDog,

Thanks for your kind words about our service!

That is a neat feature with the download option. I am not aware of a way to incorporate this feature with the Picture Gallery Widget.

You could perhaps find your own Lightbox code which offers the download feature and use the HTML Widget to add this to your site.

I'm sorry that I am not able to be more help in this regards.
Photo of BadDog

BadDog

  • 7 Posts
  • 0 Reply Likes
No problem, that's always great to see a team with such a quick answer to our issues anyway! After some research, I have discovered that the latest versions of the lightbox javascript codes around allow this, but I can understand that this is not a feature worth the whole process of updating the code for every user here (as it may be slightly different and having users change their already working sites might not be a good idea!).

Maybe you can tell me though, if the plugin requires me to add lines of code into the header, in addition to the HTML widget, only Silver members can access the headers, right? Just to be sure!

Thank you very much anyway!
Photo of diane

diane

  • 1238 Posts
  • 121 Reply Likes
Hi, BadDog,

I love to prove Sanja wrong--hee hee! {ducking quickly from the back of Sanja's hand}

There is a way to do this. But of course try it on a test page first!

Click on "Edit" in the upper left hand corner of the Picture Gallery Widget. Click where it says: "Click here to edit photo hover text". Add the following code:



<a href="/resources/testpdf.pdf">Download File</a>



Change the testpdf.pdf part to the name of your file that you have uploaded to your File Manager. This will place a link on the large lightbox image. You can see a sample here: http://testvillage.yolasite.com/galle.... Click on the first image and you will see the Download File just above where it says the number of images in the lower left corner. This is clickable.

Hope this helps!

P.S. you may need to publish to get this to work
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Haha.. no backhanding here! I actually did think of this but wasn't sure if that was what BadDog was looking for! Glad you were able to pipe up with this solution!
Photo of BadDog

BadDog

  • 7 Posts
  • 0 Reply Likes
Thank you Diane, very much! You saved my day, I've been trying to get some things to work with coding and so on during the last night, but your solution is "simply" great, because:
1) it does what I was looking for, a download link.
2) it allows me to keep on using the gallery widget which is nice for batch uploads, with many photos.

I browsed some of your posts, and as you seem to you know quite a few things that might help us newcomers, I also wondered if there was a way to force the download of a picture, with your solution: right now, it opens the picture in the same tab. Could it be possible to force a download directly, or even open it in a new tab? Don't worry if it's not possible within the gallery widget, your download link is already great, it was just to know if it's possible!

I really like when users (and staff) help each other like this, it is what makes internet a good place to learn and try to put in practice our ideas! (and Yola does that very well too!). So thank you a lot, both of you! Your answer Sanja (which is a beautiful name by the way) helped other users to point towards the solution! And help (even when it's only an answer, and not a solution) is greatly appreciated!

Sorry if I'm hard to understand sometimes, English is not my main language!
Photo of diane

diane

  • 1238 Posts
  • 121 Reply Likes
Your English is fantastic! I'm glad to help. I will have to think about it--adding target_blank doesn't seem to work, probably because of the lightbox. I am going to be out all day tomorrow so won't get a chance to monkey with this until Tuesday. I will let you know if I come up with anything.

P.S. Sanja knows more than me and half the world put together!! :)
Photo of BadDog

BadDog

  • 7 Posts
  • 0 Reply Likes
Thank you :)

I am in no rush, I'm already glad I found someone willing to help, so take your time! I tried the blank target method and it works well, although when we return to the previous tab, the lightbox is now closed (but a right click and "save target" leaves the lightbox open). It is not really annoying, but if you find a way to avoid this, let me know, I'll be glad to update my code!

Thanks again, and take care!

P.S. I have read enough posts here lately to know Sanja is of really good help too ;-)
Photo of diane

diane

  • 1238 Posts
  • 121 Reply Likes
Hi,

All the codes I found for forcing a download are php which Yola does not allow. You could try putting your image in a zip file and the browser should download that.

As for having the lightbox stay open when you return to it...I couldn't find anything for that either. Sorry I can't be more help in that regard.
Photo of BadDog

BadDog

  • 7 Posts
  • 0 Reply Likes
Thanks for your time, I really appreciate it!

That's ok, with your method, I have been able to add a small icon next to the text : "download file" on the lightbox, and if needed, I could add "right click", but I don't think I'll have to. The zip method might come handy too!

I'm glad you were there, you helped a lot! Take care, cheers!