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
Hello,
I have a nested view with a title and a media picker, what I want to do is display the nested view in a list with.
my code below works sort of, with the fact that I got the nested content being displayed. however its not picking up the document from media picker.
@inherits Umbraco.Web.Mvc.UmbracoViewPage <div class="coltest w-row"> <div class="col0 w-col w-col-6 w-col-small-6 w-col-tiny-6"> <div class="blue-box"> <h3 class="table-heading">Description</h3> </div> </div> <div class="col0 w-col w-col-6 w-col-small-6 w-col-tiny-6"> <div class="blue-box right-line"> <h3 class="table-heading">Download</h3> </div> </div> </div> @{ var accordionList = Model.Value<IEnumerable<IPublishedElement>>("matttest"); } @foreach (var panel in accordionList.Where(x => x.IsVisible())) { <div class="coltest w-row"> <div class="w-col w-col-6 w-col-small-6 w-col-tiny-6"> <div class="div-block-21 w-clearfix"> <div class="folder-title"><a href="@panel.Value("boardPaperFile")" class="footer-title-link">@panel.Value("boardPaper")</a></div> </div> </div> <div class="w-col w-col-6 w-col-small-6 w-col-tiny-6"> <div class="div-block-21"><a href="#" class="w-inline-block"><img src="~/images/writing.png" width="34" alt="" class="file-image"></a></div> </div> </div> }
Thanks in advance
Hi Matt,
So, a Media Picker will most likely be returning an IPublishedContent
So, you might need to do the following:
@{ var paperFile = panel.Value<IPublishedContent>("boardPaperFile"); if(paperFile != null) { <div class="folder-title"><a href="@paperFile .Url" class="footer-title-link">@panel.Value("boardPaper")</a></div> } }
Hope it helps.
Nik
Hello Nik,
Thanks for the reply, that seems to have it working!
Thanks
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Display image from nested content
Hello,
I have a nested view with a title and a media picker, what I want to do is display the nested view in a list with.
my code below works sort of, with the fact that I got the nested content being displayed. however its not picking up the document from media picker.
Thanks in advance
Hi Matt,
So, a Media Picker will most likely be returning an IPublishedContent
So, you might need to do the following:
Hope it helps.
Nik
Hello Nik,
Thanks for the reply, that seems to have it working!
Thanks
is working on a reply...