@inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.GuideList>
@using ContentModels = Umbraco.Web.PublishedContentModels;
@{
Layout = "Master.cshtml";
}
<div class="body-section">
<div class="body-container w-container">
<h1 class="home-page-heading">@Model.Content.Name</h1>
@foreach(var pDocument in Model.Content.Children())
{
var documentPicker = item.GetPropertyValue<IPublishedContent>("documentPicker");
<div class="faq-wrapper">
<div class="guidandpolicies-wrapper">
<div class="w-row">
<div class="w-col w-col-2">
@{
if (documentPicker != null)
{
<a href="@documentPicker.Url" class="document-link-block w-inline-block"><img src="/images/policies_image_1policies_image.png" alt=""></a>
}
}
</div>
<div class="w-col w-col-10">
<div class="guidanceandpolicies-info-div">
<h5 class="gnp-title"><a href="@pDocument.Url" class="document-link-text">@pDocument.Name</a></h5>
<div class="gnp-document-info">This is some text inside of a div block, document description here.</div>
</div>
</div>
</div>
</div>
</div>
}
</div>
</div>
All I want to do is get the pdf document which I upload to show on my page, I used the media picker code but for some reason I'm getting the following error;
Compiler Error Message: CS0117: 'umbraco.item' does not contain a
definition for 'GetPropertyValue'
Line 13: var documentPicker =
item.GetPropertyValue
Code not working for media picker
Hello all,
I have the follow code;
All I want to do is get the pdf document which I upload to show on my page, I used the media picker code but for some reason I'm getting the following error;
Thanks in advance, Matt
What is
item
in this context? Are you, perhaps, intending to access thepDocument
variable (in your loop) instead?ie. you need to do:
is working on a reply...