This project is read-only.

Custom rendering of projection

Topics: General
Sep 27, 2012 at 5:43 AM

Hello all,

I would like to ask for a strategy to do custom rendering of data base on Projection.

Say I have a ContentType named People which has TitlePart and a Numeric field Age. I then create some Content Items of People as:

  • James 18
  • John 19
  • Robert 20
  • Michael 21
  • William 22

Next, I create a query to get all People Content Type, whose age is less than 25.  I then create a Projection named People for that query and show it on main menu.

When click on the People menu, it displays a list of all 5 created people in the default format.

My questions:

  1. What I supposed to do to have it display in table format? The table should have "Name, Age" for header, and all 5 people in sub-sequence rows.
  2. Say I want to plot the Age bar chart, how can I get the data to plot?

The problem is I cannot get hold of all data (5 people) any where.  If I override the "~/Themes/TheThemeMachine/Views/Content-ProjectionPage.cshtml", I could not find a way to get that 5 data from Model.  If I override the "~/Themes/TheThemeMachine/Views/Content-People.Summary.cshtml", only single data is available thru the Model.

Thank you,




Sep 30, 2012 at 10:35 PM

Write your own projection layouts.