[Progress Communities] [Progress OpenEdge ABL] Forum Post: Accessing Related Images in MVC Widget Template

Status
Not open for further replies.
B

bwilson

Guest
Hello, I'm trying to create my first custom module and MVC templates. I've created the module and included a field called "Picture" of type "Related Media". I'm trying to create a custom list view for the module items and cannot seem to access the media properties. I keep getting this error in the error log: Message : 'Telerik.Sitefinity.Frontend.Mvc.Models.DynamicDataItemFieldAccessor' does not contain a definition for 'Picture' Here is the relevant code from my template - I started by copying the default list template and made modifications. Am I referring to the Picture field incorrectly? Thanks for any help you can offer. @model Telerik.Sitefinity.Frontend.DynamicContent.Mvc.Models.DynamicContentListViewModel @using Telerik.Sitefinity.Frontend.DynamicContent.WidgetTemplates.Fields.Helpers; @using Telerik.Sitefinity; @using Telerik.Sitefinity.Data.ContentLinks; @using Telerik.Sitefinity.Frontend.Mvc.Helpers; @using Telerik.Sitefinity.Frontend.Mvc.Models; @using Telerik.Sitefinity.Web.DataResolving; @using Telerik.Sitefinity.Model.ContentLinks; @using Telerik.Sitefinity.Modules.Pages; @Html.Script(ScriptRef.JQuery, "top", false) @foreach (var item in Model.Items) { var navigateUrl = HyperLinkHelpers.GetDetailPageUrl(item, ViewBag.DetailsPageId, ViewBag.OpenInSamePage, Model.UrlKeyPrefix); @if(item.Fields.Picture != null) { } else { } @item.Fields.Name @item.Fields.Phone }

Continue reading...
 
Status
Not open for further replies.
Top