I have created a content type called ProductPack which contains two MediaLibraryFields. One for the pack image and one for a link to a youtube video. It also contains a few more fields a custom product part and a few other core parts.
I have a module for a product which defines the product part with a few fields for prices etc.
I'm not sure if this is the best way to go but have create a shape override to override the whole content details display for the productpack and am manually rendering out the display with a bunch of if statements.
So for instance I access the ProductPack image like
var productImage = Model.ContentItem.Product.ProductImage;
Then I have
@if (productImage != null && productImage.MediaParts.Count > 0)
<img src="@productImage.MediaParts.MediaUrl" />
My question is how can I do this for a MediaLibraryPickerField based on OEmbedPart?
I cannot seem to access the Url for the youtube video to render out.
Or is the approach I have taken the wrong way to do this?