0

I have custom ContentType with one field of type Image. Currently, when I edit a node I can only upload new images from local to server. I want to have the option to select images already existing on the server.

I think that the way to go is to use the EntityBrowser and/or FileBrowser modules but I don't know how to make this work. I can create the EntityBrowser instance but how do I tell the ContentType field Image to use it?

I'm on Drupal 8.

Your help is appreciated. --Josef

  • I use this module drupal.org/project/imce it allows you to add a link next to the file upload field where a user can select existing images on the server – Leigh Oct 16 at 9:09
  • Thanks for the hint. Do I have to set it up somehow? I have enabled the module and revised the config but it's not showing up where expected :-( I'm on Drupal 8. – PerfectGamesOnline.com Oct 16 at 9:23
  • Found it. You have to click the settings icon on the right in "Manage Form Display". There is the magic "Allow IMCE" check box. Thank you! – PerfectGamesOnline.com Oct 16 at 9:51
4

Projects are built from the start to use the Media module and reference entities instead of files directly. That is how Entity Browser can help.

Here is how it's usually done:
https://www.drupal.org/docs/8/modules/entity-browser/how-to-configure-an-image-widget-to-re-use-existing-files.

More useful resouces:
https://www.drupal.org/docs/8/core/modules/media/faq-transition-from-media-entity-to-media-in-core
Is there any way to reuse the same file or image?

There's a way to convert your files into entities, there is the Migrate File Entities to Media Entities module, and some useful info about it:
Migrate File Entities to Media Entities in Drupal 8,
How do I migrate file entities into media entities?

0

I ended up using the IMCE module which was the simplest solution for me, following the Leigh's suggestion.

After installing, I had to click the settings icon on the top right corner in the Manage Form Display page. There is the magic Allow IMCE checkbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.