Varbase Media Header (vmh) does not provide sufficient installation of media_field so it can be used in views.
If I follow the following steps
1) Fresh install of varbase and varbase_media_header
2) /admin/config/varbase/varbase-media-header and select 'Basic page'
3) Add a video as remote video
4) Add a basic page with video as VMH video
5) Check: /admin/structure/types/manage/page/fields has field Main media (field_media)
6) Add a view of content: basic page and display unformatted list of fields:
6 a) Try to add the field Main media (field_media) and it is not listed.
7) If I now change docroot/modules/contrib/varbase_media_header/src/Form/VarbaseMediaHeaderSettingsForm.php lines 121->131 to
$label = "Main Media";
$type = $bundle_key;
$field_storage = \Drupal\field\Entity\FieldStorageConfig::loadByName('node', 'field_media');
$field = \Drupal\field\Entity\FieldConfig::loadByName('node', $type, 'field_media');
if (empty($field)) {
$field = \Drupal\field\Entity\FieldConfig::create([
'field_storage' => $field_storage,
'bundle' => $type,
'label' => $label,
'settings' =>
array (
'handler' => 'default:media',
'handler_settings' =>
array (
'target_bundles' =>
array (
'image' => 'image',
'remote_video' => 'remote_video',
'video' => 'video',
),
'sort' =>
array (
'field' => '_none',
),
'auto_create' => false,
'auto_create_bundle' => 'remote_video',
),
),
]);
$field->save();
}
8) /admin/config/varbase/varbase-media-header and select 'Landing page'
4) Add a landing page with video as VMH video
5) Check: /admin/structure/types/manage/landing_page/fields has field Main media (field_media)
6) Add a view of content: landing page and display unformatted list of fields:
6 a) Try to add the field Main media (field_media) and it is listed: "Appears in: landing_page. Also known as: Content: Main media"
I'll try and create a patch with this. I wonder if the field can be added to a content type is a 'raw' way with \Drupal\field\Entity\FieldConfig::create and then the config still modified with the yml file so we have the best of both worlds?
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.