So I am using a Content Picker to display a list of selected items, and by default the out put looks like this:
Testimonial: View, View
But I would like it to actually show the parts of the ContentItem. This is the code that loops through the items:
@using Orchard.ContentPicker.Fields
@using Orchard.Utility.Extensions;
@{
var field = (ContentPickerField) Model.ContentField;
string name = field.DisplayName;
var contentItems = field.ContentItems;
}
<p class="content-picker-field content-picker-field-@name.HtmlClassify()">
<span class="name">@name:</span>
@if(contentItems.Any()) {
foreach(var contentItem in contentItems) {
<span class="value"> @Html.ItemDisplayLink(contentItem)</span>
if(contentItem != contentItems.Last()) {
<span>,</span>
}
}
}
else {
<span class="value">@T("No content items.")</span>
}
</p>
I've tried several different ways of accessing the data but usually end up with warnings saying that it does not contain a reference, or that it can't convert it to a string.
I know that on the actual page for these items, they're in Model.ContentPart.Quote.Value
Edit I think the problem I am having is that I on the main page, I can't go to Models.Content.Quote or anything similar to access the data because its not listed on this page. The only data about each Quote thats listed is the ID.