How to get Projection item value from Model?

Topics: Customizing Orchard
Oct 5, 2012 at 5:43 PM
Edited Oct 5, 2012 at 6:03 PM

I render a list of items from Projection through A Grid layout and I need to generate a custom link on a property. To achieve this I created an alternate view MyTheme/Views/Properties-url-myprojection.cshtml and it is definetely hit.  I found expressions what I need on Model tab of Shape Tracing and inserted them into the view



<div class="pr1"><a href="~/Contents/Item/Display/@Model[0].ContentItem.Id">@Model[0].Item</a></div>


Those values are filled in and real ones on Model tab but empty on the view.

What have I missed here guys?


Oct 8, 2012 at 1:14 PM
Edited Oct 8, 2012 at 1:15 PM

Can anybody explain please why the real syntax is different on the view than in Shape Tracing?

Shape Tracing shows values in

@Model[0].ContentItem.Id and @Model[0].Item

but on the view those expressions are empty. After much time I found values in

@Model.Items[0].ContentItem.Id and @Model.Items[0].Item

Is that discrepancy known fact or a bug?
Oct 10, 2012 at 12:31 AM

Please file a bug.

Oct 10, 2012 at 8:29 AM