https://www.webwash.net/manage-media-assets-drupal-8/
Note: Media module will install types:
- Make sure CTools is installed
- Enale Core Media module
- Download and enable 'Entity Browser' and make sure it is on 2.x branch
drush dl entity_browser-2.x
- Download and enable 'Media Entity Browser' and make sure it is on 2.x branch
drush dl media_entity_browser-2.x
- enable
Media Entity IEF
module
We want to create form modes specifically for Media entities when creating inside a piece of content. Here we will get that ready.
- Add new Form Mode for Media
- Got to Structure >> Display Modes >> Form Modes >> Add
- Click Media
- Add "Inline Form"
- Create New Form
- Goto Structure >> Media Types >> Video >> Manage Form Display
- Open Custom Display Settings
- Add "Inline Form"
- Go to Inline Form tab
- Remove un-needed fields
- Create Entity Browser (video)
- Create Media View for video
- Edit /Media Browser/ View
- Duplicate Display
- Change Filter criteria
- Media: Media Type should not be exposed
- And Video selected (This display only)
- Add Widget (view) with newly created view display
- Under the "Configuration" tab click on "Content Authoring".
- Click "Entity Browsers"
- Add Entity Browser
- In "General Information", edit the necessary settings and click "Next".
- Edit "Display" settings.
- You may skip the next two steps, "Widget Selector" and "Section Display" as you will not have configuration options.
- In the "Widgets" section, select the necessary widgets to add and edit the widget settings as needed.
- When you're done, click "Finish"!
- Go to Manage Fields on Node CT
- Add field
- Reference -> Media
- Add title and machine name
- Set settings
- Goto Manage Form Display
- Widget set to Inline Entity Form - Complex
- For those settings
- Form Mode: Inline Form
- Allow users to add new
- Allow users to add existing
- Autocomplete: Contains
- Entity Browser: Video Media Browser
- SAVE