Jump to content

Recommended Posts

Posted (edited)

BETA: SplashAndGrab

https://github.com/madebymats/InputfieldSplashAndGrab

This module attaches a search input to selected image fields that lets you search and download images from Unsplash.
(Unsplash is a stock photo service where you can download images for free and use as you wish. No strings attached.)   
You can search by string, colors, orientation/crop and order by relevance or time published

I find Unsplash useful both for placeholder images when building sites but also as a time saver for editors if they don’t have any images at hand, just search, download and publish.

splashandgrab.thumb.jpg.c9ffce8944a65d35ffe1e53fe081209f.jpg

Thanks to @apeisa for building the  FlickrInputField Module and @Robin S for AddImageUrls,  took a lot ideas and code from those modules.

Edited by Mats
Added @'s and image
  • Like 17
Posted
28 minutes ago, kongondo said:

Loving the name ? 

The name might be the best part of the module. ?

A Readme is added.

  • Like 3
Posted
1 minute ago, Mats said:

Hi @bernhard! No, i haven't thought about that. 

= I have not thought about that, but it's a good idea and easy to implement.
= I have not thought about that and I'm not willing to add any other services.

? ? 

  • Like 2
Posted

Cool - i was building this, but i got stuck on the Unsplah api which was telling me they didn't like downloads and wanted to only allow usage that would use the source image from them, and this wouldn't work with an images inputfield, or imagesizer engine, or any other image manipulation like srcsets etc; So i gave up... Looks like somehow you solved all of this, so thanks!  Does this use a fixed api key, or will that api key need to be configurable at some point?

 

  • Like 1
Posted
1 hour ago, bernhard said:

= I have not thought about that, but it's a good idea and easy to implement.
= I have not thought about that and I'm not willing to add any other services.

= I have not thought about that and I don't  know how o add any other service.  ? 

2 hours ago, Macrura said:

Does this use a fixed api key, or will that api key need to be configurable at some point?

This uses a fixed api key. 

 

  • Like 2
  • 5 weeks later...
Posted

Hi @Mats

thank you for this module!

I noticed an issue when trying to crop images which where downloaded via this module on saving. The error said that the image could not be found.

I assume this has to do with the page file name, which has a "." in its name, which seems to be a problem.

I replaced the renaming with following line, which solves this problem for me. Maybe it's helpful for someone else coming accross this.

$pagefile->rename(str_replace('.', '-', $pagefile) . ".jpg");

 

  • Like 3
  • 2 weeks later...
Posted (edited)

I have noticed that on pages where an image field with this feature is activated, I get a warning that the page is being edited in another window that is generally off by a few minutes. I was not seeing this issue at all prior to adding the module. The page saves without issue, but immediately after saving the warning will pop up sometimes.

Irrelevant.

But here's something that's not - unsplash is charging now for their API. Can you include a place to include licensing on the backend for folks who still want to use them?

Edited by gornycreative
  • Like 1
  • 4 years later...
Posted

Something else I noticed recently, when a page has two unsplash inputfields on the same template they are linked, so perhaps the js needs more granular selectors for the interaction layer so that each inputfield can operate independently.

This module otherwise still works very well.

I think pulling the data-id value from the element and attaching it to the `splashAndGrab` id on the fieldset in the js and form output will fix it. If I can get something working I will sub a PR.

This was simpler than I thought. I want to test a few more things but I believe I got this working in a way that allows for multiple separate instances. Once I test a little more I will sub a PR.

  • Like 1

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...