Environment: Sitecore 9.0.2 + Glassmapper
I am trying to create a component like this.
So in the template, for the images (stored in Sitecore Media Library), I have taken a field of type TreeListEx.
From a TreeListEx type field, Sitecore returns the item-ids of the selected item.
So, when I use the syntax @Html.Glass().RenderImage(item, x => x, null, true)
, the parameter item
is the Sitecore Id of the image item and the output of the above syntax is an empty string.
- Am I missing something?
- Should I make a call to Sitecore for each media item Id to get the item and pass it to the Glass Mapper?
I did saw the link https://horizontalintegration.blog/2018/02/07/sitecore-glass-mapper-gettargetobjectoflamba-exception/ and believe Ram is also passing the Id.