Hello
I'm new to D8 but have built few D6 sites..
Trying to catch up on this module and not sure what I'm missing. Sitting here for couple of hours reading issues and searching..
Can anyone add a short documentation or readme on how to use this module.
I want to add a video field to an existing content type.
thanks in advanced.

Comments

zisser created an issue. See original summary.

slashrsm’s picture

There are some docs in our media guide: https://drupal-media.gitbooks.io/drupal8-guide/content/modules/media_ent...

It is still very basic. We are looking for contributors.

markconroy’s picture

Hi Zizzer,

Media is handled in Drupal 8 much differently to how it is handled in Drupal 6. For one, each media item (video, image, etc) is an entity of its own, like a node is in Drupal 6.

What you will need is to create a media 'Bundle' (like a content type in Drupal 6) and then create some media items (links to videos, uploaded images, etc). You then create a 'reference' field to 'refer' to a media item in your node.

While the above is conceptual, the steps you need to follow to add a video field are:

Modules:

Creating media bundle for video:

  • Go to your Media Bundles page - admin/structure/media
  • Click on 'Add media bundle'
  • Call the new bundle anything you want; I chose 'Video'
  • On the 'Type provider' dropdown choose 'Embeddable video'
  • Ignore 'Field with source information' for now
  • Click on 'Save media bundle'
  • On the next page, where your media bundles are listed, click the drop down icon beside the word 'Edit' and choose 'Manage fields'
  • Next click on 'Add field'
  • Add a field of type 'Link', call it something like 'Video'
  • Choose your settings and then save the field
  • Go back to your media bundles page and click 'Edit' beside your video bundle
  • Under 'Field with source information' (which we ignored a minute ago) choose your new 'Video reference' field and then save this page

We now have a media bundle with a field that can accept links to videos.

Adding media items to content:

  • To be able to use this field on other entities (such as content types or taxonomy terms), we need to add a reference field on those entities
  • Go to your content types page - admin/structure/types
  • Click 'Manage fields' beside the content type you want to have a video on
  • Click 'Add field'
  • Add a field of type 'Reference >> Other' (yes, not very obvious!)
  • Give it a label of something like 'Video reference'
  • On the 'Type of content to reference' select list choose 'Media' and then save the field
  • Choose your media bundle that this field will reference near the bottom of this page - 'Video' and then save the page

We now have a media reference field on our content type.

Putting it all together:

  • Add a media item on your media page - admin/content/media
  • Add a new page of the content type that you put the media reference field on
  • In the media reference field, add the media item you created just a moment ago.

Viola!
P.S. You might need to play around with your 'Manage Display' settings on the media bundle and the content type to get the video to display as you wish.

@slashrsm - I've cloned the media docs guide from GitHub and will add a version of this as a pull request to it.

xjm’s picture

Issue tags: -Need documentation