9

I am looking for suggestions on Best Practices for D8 and files / media entities. I originally added this as a answer but kiamlaluno evidently felt that it should be a new question in itself so here goes.

I trying to figure out the best way to handle files and media entities. With the increase of development in the file entity module if appears that things are once again getting way over complicated since files can now be a full blown entity. In my opinion this is going to put a lot of people off as to which way is the most practical way to go.

What I would love to see is a tutorial or a write up on best practices of when to use the file field versus the media field and the pros and cons of each. Drupal 8 by default gives us a Article content type which is a file entity. So should we use this for images or delete it and use media fields.

Does anyone know of a recent tutorial or discussion for review?

  • This will probably be closed as tutorials or write-ups like these are in the "off-topic" list. – mradcliffe Feb 10 '17 at 20:05
  • Probably however this also is part of the issue with getting D8 more main stream in my opinion and doing a simple question of "Which is better to use the included file entity or the module based media entity" would generate to vague of an answer. – Chris Riley Feb 10 '17 at 20:20
13

Use media_entity. End of discussion.

People are actively working on getting it into core and once that happened, there is no reason to use file_entity anymore.

We (as in me and @slashrsm/MD Systems) will continue to minimally maintain it, as we have a number of big sites (a distribution actually) that relies on it, but it will most likely never get out of alpha while media_entity is already stable.

We're actively blogging about the status and progress on getting media into core:

  • 1
    Thank you so very much Berdir for answering this question. I have had numerous people "offline" me with the same question and or applauding me for asking the question. – Chris Riley Feb 10 '17 at 20:46
  • Don't use media_entity if you already have a bunch of files in your system, end of discussion. – Patrick Aug 2 '17 at 16:22
  • Media entity seems to only be useful if you are just starting out. Not modifying an existing site. Or at least one that you have already migrated a ton of content into. Otherwise it fails entirely to help you avoid a lot of extra work. – Patrick Aug 2 '17 at 16:23
  • File Entity will actually recognize and load your existing files with no problem. – Patrick Aug 2 '17 at 16:24
0

Of course, the topic is still evolving, but as of the latest Drupal core (8.6.x), Media is indeed now included, and has come a long way since its D7 roots.

Although there's still a lot to be added, documentation on it does exist. Another advantage of going with Media is that images, files and other assets are more easily reusable, as well as not tied to specific content nodes, making syndication and content migrations easier. (@Berdir, et.al., please correct me if I'm in error).

As @pthurmond notes, it probably is only good if starting a new site. On that, I can speak from experience, relaunching a D7 site as D8, which was completely rebuilt from the ground up. May be worth it for some cases, but could be a monumental hassle, at least at the moment, if migrating an existing large site to the Media Entity paradigm.

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.