How do I modify my menuitemlink shape to display a media picker field

Topics: Customizing Orchard
Sep 17, 2012 at 10:12 PM

I added the ​Media Picker Field to my custom link content type. I gave it a display name of 'Image' and then added an image through the navigation area.

I now want to modify the MenuItemLink.cshtml file to add the image but I don't know the syntax. Here is the original shape:

<a href="@Model.Href">@Model.Text</a>
How do I reference the image that I added?

Sep 17, 2012 at 10:15 PM

Probably something like Model.ContentItem.WhateverYourCustomLinkTypeNameIs.Image.Url

Sep 17, 2012 at 10:53 PM

i don't get it. I tried:

@Model.ContentItem["Custom Link"].Image.Url 

but no luck.



Sep 17, 2012 at 11:20 PM
Edited Sep 17, 2012 at 11:22 PM

Got it. I needed to enter: Model.Content.ContentItem.MenuItem.Image.Url