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

Topics: Customizing Orchard
Sep 17, 2012 at 11: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?

Coordinator
Sep 17, 2012 at 11:15 PM

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

Sep 17, 2012 at 11:53 PM

i don't get it. I tried:

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

but no luck.

 

 

Sep 18, 2012 at 12:20 AM
Edited Sep 18, 2012 at 12:22 AM

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