Open jlahijani opened 6 years ago
this would for sure be a great addition. though i'm not sure how this could be solved properly. i don't think it would be a good solution to have an additional fieldtype. take a simple blog as example: say i have a page with 3 fields: title, picture, body - it would be nice to have the possibility to choose the image for the "picture" field from a kind of media gallery. but if we had the requested image reference field the template would have 4 fields instead of 3 and we would have to take care of that (both in the admin ui and also on the frontend output). or am I misunderstanding your request?
On the other hand, if we hand something that extends the image field and we could choose an image from another page and just use it as if it was uploaded regularly ( echo $page->picture->url ) this could get quite complicated regarding different crops and so on. But maybe that would be easier than I think?
Also if the image on the other page was deleted this could lead to problems. The ckeditor field has the "fix broken images" option. So maybe the principle could be the same in both cases?
Big +1 for this - I think it would be really useful.
A couple of other use cases:
og:image
, etc) for a page from images uploaded to the page.I came across this with a recent destination marketing site where they often recycle the same image many times in blog posts and event listings. I know we have a few third party options, but I think it's time for a simple core solution to this. I don't think it should be the general practice for site editors to use a media library approach like other CMS's, but I definitely think there are some valid use cases for it.
I was the OP for the forum post. I haven't revisited this for a while as I am sure this appeared on the roadmap at some point, but it doesn't seem to be on there anymore. This still needs doing I think. We live in a world of usability improvements and this would be a huge one.
Maybe the clearest approach would be to implement a central media library – maybe just a "virtual one", meaning some images are marked as "shared" – available to each Image inputfields, I literally mean it could be integrated into the inputfield itself, I mean the GUI. When uploading an image, user should be able to decide "where" to upload it.
Pretty sure this was what was on the roadmap, not a media library but a central place. I was over the moon when I saw it, it is the one thing my clients highlight.
While I definitely agree with the original proposal of "image reference fields", this seems to be going to a direction where I don't personally feel that the core should go – and by that I mean taking the "media library route".
Not only would it be a pretty big conceptual change to our current approach, where files are tied to pages, but it would also come with a number of side effects (thinking of permissions, page-specific variations, and such), and it probably wouldn't make sense for a vast majority of ProcessWire sites (that's mostly just a hunch, though).
To summarise: I think that there's a pretty big difference whether we implement a full-blown media library (note: even if it starts small, this is one of those features that are bound to escalate) or just make it easier to reference existing images tied to other pages. Perhaps it's just my imagination, though, and we might run into same issues either way?
In my experience so far a media library is not something that most sites need, and thus it's a perfect fit for a separate module. The Media Library module does great job at implementing a light-weight media library on top of ProcessWire. I've used it in some projects, and can definitely recommend it for all your media library needs. (Repeat much?)
We have allready the approach to select / inject an image from an imagefield on the same page or a different page into CKE. Exactly only that is missing for use cases without CKE fields. A field where you can reference a image from a "real image field", like a page reference field, where you can select a page. :) So, what should be open to the discussion is, if it should be (optionally) restricted to a configurable single or multiple fields, or if it simply should be open for all imagefields on pages the users has access to?
I didn't see it mentioned anywhere, but there is also https://processwire.com/talk/topic/18391-imagepicker-field/. Note: I haven't tested it.
if it should be (optionally) restricted to a configurable single or multiple fields
This one. I'm pretty sure we need to be able control this.
I want to push the discussion here once more. I think the Image reference option to reuse images in Imagefields (also Filefields) is absolutely essential. Unfortunately, my customers often decide against ProcessWire due to a lack of simple image management and prefer to use Wordpress. I know this discussion has been going on forever. The Media Manager module (and all other attempts to solve this as a module) all do not fit into a scalable usecase. Processwire is so clearly defined and structured. It's a mystery to me why this doesn't also apply to assets today.
@teppokoivula
While I definitely agree with the original proposal of "image reference fields", this seems to be going to a direction where I don't personally feel that the core should go – and by that I mean taking the "media library route".
Not only would it be a pretty big conceptual change to our current approach, where files are tied to pages, but it would also come with a number of side effects (thinking of permissions, page-specific variations, and such), and it probably wouldn't make sense for a vast majority of ProcessWire sites (that's mostly just a hunch, though).
I agree with all, but also with Teppo. Don't know is this good idea, but maybe we can "clone" existing image? To do that, need to extend current image upload process with additional task: 1) "Add/insert existing image?" or 2) "Upload new image/images" If option 1: Clone existing image to on page image field (backend Ajax process) If option 2: Same as usual (default)
For user interface, maybe there is option to trigger/use image selector inside CKeditor... Also, I think that all this can be tested using hooks, eg. append additional button next to "Add image" (or small dropdown inside button), and all other logic go into the hook (include javascript part, processing...). Regards.
Just for reference: https://processwire.com/talk/topic/22665-module-imagepicker-pick-images-from-various-sources/. If the amount of third party solutions developed for the task was considered any sort of measurement of popularity, I think this feature request would be pretty high on that list :)
Just a note to anyone visiting this, the "Image From Page" module was renamed to "Image Reference" and therefore has a new link: https://processwire.com/talk/topic/22665-module-imagereference-pick-images-from-various-sources/
Another third-party option: InputfieldSelectImages + FieldtypeDynamicOptions
And yet another option: https://github.com/gebeer/FieldtypeImageReference
And another one for simple (single) image picking: https://github.com/baumrock/RockImagePicker No readme yet - but it's really just installing the field...
ProcessWire has the Page Reference field, however perhaps it would also benefit from an Image Reference field. Here's why this may be needed.
Let's say I have a page and it has a regular "Images" field where I can upload a bunch of images. Now let's say I also have a repeater matrix on that page to build various page blocks, and one of those matrix-types has 2 fields (let's say "body" and "image", where the "image" field is an single upload image fieldtype). There may be a situation where the image I want to put in that matrix "image" field has already been uploaded to the "Images" field I created for the template. So rather than upload it twice, it would be nice if there were a way to select an image from that images field, much like a page field.
This would prevent me from having to upload the image twice, or any other hackish workarounds.
Worthy of core?
Discussions similar to this are here: https://processwire.com/talk/topic/10009-image-field-select-image-from-another-page/
Module (ProcessWireImageLink) -- I haven't tried this: https://github.com/nikosch/ProcessWireImageLink