customizing projection page

Topics: Writing themes
Mar 20, 2013 at 6:25 PM
Hey everyone,

I've created a projection page and it renders an ul and li's. Inside these li's there are content item displayed (employees) which display:

Title
text
email
telephone..

Now I want to style this for example:

Title
text
email telephone

But all it renders is @Display(Model.Content) and i can't break it down in a complete overview with shapetracing, does anyone know how to do this?

I only have fields_common_text but I can't css on that...

Kind regards,

Borrie
Mar 20, 2013 at 9:57 PM
To be more specific :)

In stead of the @Display(Model.Content) I want to display the single fields

I've already tried @Model.Contentitem.Fields["Email"] but that doesn't seem to work.

Any solutions?
Coordinator
Mar 21, 2013 at 12:42 AM
Cast Model.ContentItem to dynamic and party on: ci.NameOfTheType.NameOfTheField
Mar 21, 2013 at 12:51 AM
come again? :)
Coordinator
Mar 21, 2013 at 1:04 AM
o_O
@{
dynamic ci = Model.ContentItem;
var emailField = ci.WhateverYourContentTypeIsNamed.Email;
}
Mar 21, 2013 at 1:13 AM
Bertrand,

Sorry for being a noob, I'm just trying to understand, now my output is this: Orchard.Core.Common.Fields.TextField

How can I output the value?

Borrie
Mar 21, 2013 at 1:26 AM
Ok, I found it, tx a lot for your help!!

I Can just get it by: @Model.ContentItem.WhateverYourContentTypeIsNamed.Email.Value Have a good night!

Borrie