Robin S

Add Image URLs

Recommended Posts

An experimental module for adding images to a field via pasting one or more URLs.

Add Image URLs

Allows images to be added to an images field by pasting URLs.

image-urls

Usage

Install the Add Image URLs module.

A "Paste URLs" button will be added to all image fields. Use the button to show a textarea where image URLs may be pasted, one per line. Images are added when the page is saved.

 

https://github.com/Toutouwai/AddImageUrls

  • Like 19

Share this post


Link to post
Share on other sites

Really useful module I consider to be this one, I have done something similar on one website but was not as elegant as this one.

Thank you for your work.

  • Like 2

Share this post


Link to post
Share on other sites

nice :)

do you think you could extend this module to also store images pasted from the clipboard? 

PS: i think it would be great if the images were added via AJAX right after pasting (either urls or clipboard). what do you think @Robin S ?

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, bernhard said:

do you think you could extend this module to also store images pasted from the clipboard?

I agree it would be handy, but that would be a completely different thing to what this module is doing. This module is essentially just using Pageimages::add() on the submitted URLs, and that method has no support for clipboard data. I don't think I want to disappear into the browser clipboard rabbit-hole with this module. :-)

5 hours ago, bernhard said:

i think it would be great if the images were added via AJAX right after pasting (either urls or clipboard).

I'll have a think about it. It would make the module significantly more complex and I'm not sure how much time I want to put into it. Maybe if I get bored sometime...

  • Like 3

Share this post


Link to post
Share on other sites

I'm getting an error on this...

Error: Uncaught TypeError: Argument 1 passed to ProcessWire\Pageimage::__construct() must be an instance of ProcessWire\Pagefiles, null given, called in /home/walking/public_html/site/modules/AddImageUrls/AddImageUrls.module on line 152 and defined in /home/walking/public_html/wire/core/Pageimage.php:109

Share this post


Link to post
Share on other sites
On 03/02/2018 at 1:30 PM, hezmann said:

I'm getting an error on this...

Can you give a more detailed report please?

  • What are the image URLs you are trying to add when you see the error notice?
  • Is the issue reproducible? i.e. if you try again with the same URLs do you see the same notice?
  • If you download the images to your computer and then upload as per a normal addition to an images field, do they work then?
  • Anything special about your images field - e.g. inside a Repeater or PageTable?
  • The error seems to be related to the field name. Could you please post a screenshot of your browser dev tools showing the source code of the textarea input that this module adds to the images field (like the one below)?

2018-02-05_101903.thumb.png.20073e94b74aaec6545dfec1222a2795.png

That will help me get to the bottom of this. Thanks.

 

Share this post


Link to post
Share on other sites

I've tried several URL's from various places - all get the same error

I get it with every URL so yes, reproducable.  I have not been able to save any images this way.

Saving the image and then uploading works fine.

Not inside a repeater or anything special, just a normal Images field

Full Error: image.thumb.png.fad8a91ee02bc55c323b1e2a18e494bc.png

 

Source Code

image.png.e5ff46b25d67dac405764089cc3b7c1c.png

  • Like 1

Share this post


Link to post
Share on other sites

@hezmann, if you can give me access to your dev site (send me a message) I would be happy to take a look. Otherwise I'm out of ideas sorry.

  • Like 1

Share this post


Link to post
Share on other sites

Hey @Robin S - I thought since I've been mucking about with a lot of modules and code I would do a clean install and see what happened.  I did a 100% clean install on a site that has literally never had anything on it (I owned the domain but have never used it).  Only added one field for images with one template.  Created a page and got this error:  image.thumb.png.b057755514b928016590e05782f264ac.png

I'll send you a message with login details to the new site.  Thanks!

  • Like 2

Share this post


Link to post
Share on other sites

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By cosmicsafari
      Hi all,
      Just wondering if someone with a bit more PW knowledge than me could give a run down of what this method actually does and how its achieved.
      I get that it rebuilds image variations but based on what settings?
      If I wanted to rebuild all the websites image variations but at say a reduced image quality can this be set somewhere globally that this method would take into account?
      For some context I have built a fairly simple module to delete all the image variations connected to any FieldtypeImage which is being used on the website, for the most part this works quite well. As I was quite happy with how that turned out I figured I would give the module another option to rebuild the images also. So there would be a 'Remove' and 'Rebuild' button on the modules config page.
      The idea being that I could use this tool to delete all the image variations, update some global settings then regenerate them all but currently it doesn't appear to do that.
      I assume this is either because my codes borked or im misunderstanding something fundamental about how rebuildVariations() works.
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 30+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.51
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy!