Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
This should be working but returns nothing. Tried several ways I know but no luck. The code below is in a partial.
@{ var selection = Umbraco.Content(Guid.Parse("a51c3e15-e8e5-4985-91c2-84159b3fa2bf")) .Children() .Where(x => x.IsVisible()); }
@foreach (var item in selection) { var typedMediaPickerSingle = Model.Value<IPublishedContent>("videotwo"); if (typedMediaPickerSingle != null) { <video autoplay controls width="320" height="240"> <source src="@typedMediaPickerSingle.Url" type="video/mp4" /> </video> } }
Also tried this to display an image but that did not work either. Can anyone help to put me on the right track?
hi,
is it the selection that is empty, or the video that is not picked or not an IPublishedContent?
Hi Mark.
It might be a typo, but Model should maybe be item?
var typedMediaPickerSingle = item.Value<IPublishedContent>("videotwo");
Thanks Bo. Worked perfectly.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
video/image not displaying using partial
This should be working but returns nothing. Tried several ways I know but no luck. The code below is in a partial.
@{ var selection = Umbraco.Content(Guid.Parse("a51c3e15-e8e5-4985-91c2-84159b3fa2bf")) .Children() .Where(x => x.IsVisible()); }
Also tried this to display an image but that did not work either. Can anyone help to put me on the right track?
hi,
is it the selection that is empty, or the video that is not picked or not an IPublishedContent?
Hi Mark.
It might be a typo, but Model should maybe be item?
Thanks Bo. Worked perfectly.
is working on a reply...