This project is read-only.

Access media library picker field in content type summary

Topics: General, Writing themes
Apr 29, 2014 at 4:34 PM
I'm trying to get @Model.ContentPart.SamplePagePDF.MediaParts[0].FileName of media library field (SamplePagePDF) on Content-SamplePage.Summary.cshtml but I'm not able to access it from the Model on the Summary page.

I added MediaLibraryPicker field to
 <Match DisplayType="Summary">
    <Place Fields_MediaLibraryPicker="Content:6"/>
The field is visible on the summary page but I need to wrap content body and media library field inside the table.

How do I access fields on the content summary page?

Any suggestions?

Apr 30, 2014 at 1:05 AM
In the Content shape, Model is not the content item, nor does it have the content item or any content part attached to it. It is just a container for zones, into which placement will send shapes. Access your field from another shape, one that actually has access to the content item.
Apr 30, 2014 at 3:36 PM
Edited Apr 30, 2014 at 3:36 PM
Thanks. I was able to access it through the content item @Model.ContentItem.SamplePage.SamplePagePDF.MediaParts[0].FileName
Marked as answer by hsikur on 4/30/2014 at 7:36 AM