I've got a contentType (product) that has a taxonomy field (features). The taxonomy term (product feature term) has been customized to include an image field and a description field.
I'd like for the product detail view to display the image from the term along with the name, but I can't find the property to access it.
I've created the following:
Taxonomy
- ProductFeature Taxonomony
- Vocabulary: Feat1, Feat2, Feat3
ContentTypes
Product
- Fields: Features(Taxonomy)
Product Features Term
- Fields: Description(Html), Image(Image)
Views
Fields.Contrib.TaxonomyField-Features.cshtml
<!-- Old Code -->
@if (Model.Terms.Count > 0) {
<p class="taxonomy-field">
<span class="name">@name.CamelFriendly():</span>
@(new HtmlString( string.Join(", ", terms.Select(t => Html.ItemDisplayLink(Html.Encode(t.Name), t.ContentItem ).ToString()).ToArray()) ))
</p>
}
<!-- New Code -->
@if (Model.Terms.Count > 0)
{
<div>
@foreach (var myTerm in Model.Terms)
{
@Display(???)
}
</div>
}
What do replace the question marks with? I'd thought it'd be myTerm.Image but that field doesn't exist on the dynamic object.
I've attached an image of the designer viewer.