I want to be able to "link" files to my content types. Two different nodes in two different content types can link to the same file, so I don't want use file upload field to avoid content duplication.

I also want to have publicly available "repository" where there is a list of all available files and for each file there is a list of articles / nodes to which this file is linked.

What is the simplest way to achieve this. Is there a reference field or something like that?

I would like to have little search field when linking files to content.

  • Is that for Drupal 7 or 8? Apr 9 '17 at 11:20
  • Drupal 8 @StefanosPetrakis
    – Reygoch
    Apr 9 '17 at 13:17
  • All I can think of here is to use Media.
    – Kevin
    Apr 9 '17 at 15:18

You could use the excellent File Browser (https://www.drupal.org/project/file_browser) which provides a very slick interface (see DropzoneJS), for both uploading new files as well as re-using (referencing) existing ones.

As a side-note: Content duplication will not be a problem, if you offer your users the option to upload and re-use. That way, you can stick to the standard reference direction, Content -> File, instead of implementing a File -> Content (which is also valid, but, less used in my experience).


As said in the comments:

Media module is just the thing you are looking for. We are also using it in our project, it's pretty good and solves all the problems you listed.

It's maybe also important to mention that this is going to be part of the core very soon (8.4.x).

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.