Using custom shape with Contrib.ProjectionLayouts

Topics: Writing modules
Jan 23, 2013 at 4:29 AM

I have a ContentType called CustomerNotes with fields CustomerCode, Name, Note, etc. and I'm using a query with projection widget to display it. For layout I'm using the new Contrib.ProjectionLayouts and created a CustNotes.chtml for the shape. 

Question: Inside the CustNotes.chtml file, how do I access the CustomerNotes fields through Model.ContentItem?

 

@{
    var ListOfCustNotes = Model.ContentItem.{what goes here?}
}
{
   Foreach(dynamic record in {what goes here?})
	{
		
	}
}

Thanks in advance. 
Jan 23, 2013 at 8:07 PM
Edited Jan 23, 2013 at 8:12 PM

Okay, I figured it out. 

The magical Shape Tracing module revealed that @Model.ContentItems (plural) is a WhereSelectListIterator. 

Code inside the shape template looks like this: 

 

 

@{
    var ListOfCustNotes = Model.ContentItems;
}
@foreach(dynamic custnote in ListOfCustNotes)
{
    @T("<br>")
    @custnote.CustomerNotesPart.CustomerCode.Value
}