Emit HTML Table from Projection - 1 row per content item, 1 column per property

Topics: Customizing Orchard, Troubleshooting
Sep 24, 2012 at 3:54 PM

Greetings all;

I have been working with a projection based on a property query which specifies three columns (Team, Game Date, Win/Loss) per content item. This is based on a list of a custom content type.   I'd like to emit HTML for a table that looks like this:

<table>
    <tr>
        <th>Team</th>
        <th>Game Date</th>
        <th>Win/Loss</th>
    </tr>
    <tr>
        <td>XXXXXXXX</td>
        <td>10/1/2011</td>
        <td>Win</td>
    </tr>
    <tr>
        <td>YYYYYYYYY</td>
        <td>10/9/2011</td>
        <td>Win</td>
    </tr>
    <tr>
        <td>XXXXXXXX</td>
        <td>10/18/2011</td>
        <td>Loss</td>
    </tr>
</table>

 

Can a projection emit HTML in this shape or can you recommend another strategy to achieve this?

 

Many thanks in advance!

Coordinator
Sep 24, 2012 at 4:52 PM

If the grid layout is not doing what you want, you can write your own projection layout and get any HTML you want.