orchardcms - Orchard - How to display custom Term fields in a taxonomy field? -
i've got contenttype (product) has taxonomy field (features). taxonomy term (product feature term) has been customized include image field , description field.
i'd product detail view display image term along name, can't find property access it.
i've created 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 replace question marks with? i'd thought it'd myterm.image field doesn't exist on dynamic object.
i've attached image of designer viewer.

if wanted use current dev branch on module, access termspart of content items, leads applied terms.
if using version 0.9 of module, can dynamically have access fields getting reference content item, contentitem.partname.fieldname. in case of type named product, , field name feature contentitem.product.feature. if term has property named image, termcontentitem.productterm.image.
i need more information give exact syntax, type of field, exact name of content types. or can post question on module's codeplex project discussion forum.
Comments
Post a Comment