I have been trying to figure out how to have the videos pulled in using the Brightcove module display differently depending on how they are called. For example, we have a video in the hero area of every page created using one content type. Here, we only want the video thumb and the path to the video's entity/node itself. We also have a view that should show thumbnail, video title, length and that, too, should be linked to the video's node/entity. Then, on the video's node/entity page, we want more information to show: description, the video player itself, release date, etc.

As far as I can tell, however, I cannot assign different, custom view modes to Brightcove videos. The only place I see anything that looks like a display settings page is within the "Brightcove Video Settings" page under Structure. I tried using a template to show only what I need, but, for example, when I created a suggested template - field--default--node--field-brightcove-video--animals.html.twig - and attempted a kint(content) on it, all I got was NULL.

I am sure I am just missing something, but how do others that want to show different parts of the imported video information depending on page/location do so? Do you make it all happen using views? That doesn't seem very intuitive... Please help!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

justkristin created an issue. See original summary.

justkristin’s picture

I figured out how to use display modes to do what I needed. Sorry about the confusion (mine). :)
Thanks, @entuland!

justkristin’s picture

Status: Active » Closed (works as designed)
cman9090’s picture

Status: Closed (works as designed) » Needs review

Also having the same issue. There is like a half baked implementation of a media entity for Brightcove which would handle this situation but not sure how to import all the videos into this media entity instead of the normal brightcove video entity?

cman9090’s picture

Okay, to answer my own question. To be able to use different display modes for a video, we will need to use Brightcove video media entity. I've written some instructions on how to do that here. https://www.drupal.org/docs/8/modules/brightcove/brightcove-video-as-med...

It's an extra editorial step but it gives us greater control over displays, tagging etc.

oknate’s picture

see patch #8

oknate’s picture

FileSize
1.39 KB

I was missing the template file in the last patch, adding, see patch #8

oknate’s picture

FileSize
1.39 KB

last patch was off, rerolling.

This patch creates a template for the brightcove_video entity, and sets up theme template suggestions for view modes.

So if you create a teaser video mode, you could use a template brightcove-video--teaser.html.twig.

  • dfca174 committed on 8.x-1.x
    Issue #2875507 by oknate: Hoping someone can tell me how to use a...
yce’s picture

Status: Needs review » Fixed

Hi,

Thanks for the patch, pushed to dev.
I have simplified the brightcove_theme_suggestions_brightcove_video_alter() function a little bit, the suggestions variable is always an array and it is not necessary to define extra variables that are won't be used later.

  • dfca174 committed on 8.x-2.x
    Issue #2875507 by oknate: Hoping someone can tell me how to use a...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.