Is there a way to construct table layout on content type?

Topics: Customizing Orchard, General, Writing modules, Writing themes
Feb 23, 2013 at 10:56 AM
I've try to make a new content type with three content parts located on. But i can place that content parts only as one below the other. I want to make 2 content part at one row and one content part at the next row. Is it possible? Thanks for any help...
Developer
Feb 23, 2013 at 4:45 PM
Each Content Part emits shapes, which in turn get rendered. So one way you could do it is by creating a template for the content type in question, which renders a couple of local zones, which you designate each shape to using Placement.info. See http://weblogs.asp.net/bleroy/archive/2013/02/13/easy-content-templates-for-orchard-take-2.aspx for more details.
Another way of course is by accessing the Parts directly from that template and render anything you want.
Feb 25, 2013 at 5:42 AM
Yes, first approach is working. Thanks for a solution!
Mar 1, 2013 at 10:53 AM
Edited Mar 1, 2013 at 10:53 AM
Sorry, can you help one more time please? If i have two same Content Field on ContentItem, is it possible set in layout different placement for that fields? It's my theme placement.info:
<Placement>
  <!-- Customize where the shapes are rendered -->
  <Match ContentType ="TableMetadata">
    <Place Parts_ListObjectMetadata="ListObjectMetadata"/>
    <Place Fields_InspectedObjectField="EditObjectMetadata"/>
    <Place Parts_FieldMetadataPart="EditFieldsMetadata"/>
  </Match>
  
</Placement>
The "Field_InspectedObjectField" is shape returning by some ContentField that have rendered in place specified by "EditObjectMetadata".
But if i have another content field of same type that should be placed on another place, for example in place specified by "AddObjectMetadata", is it any way to make this by placement.info file or another way?
Mar 1, 2013 at 2:38 PM
Yes. The placements of fields can be done by field name as well (the id rather the display name). Notice the second statement in my placement file below:
<Place Fields_MediaPicker="RightContent:before"
           Fields_MediaPicker-SponsoredBy="Footer:3" />
So all media picker fields that I have in my content item go to the right hand side, and the specific SponsorBy media picker field ends up in the footer. I Hope that helps.

Matt
Mar 2, 2013 at 3:36 AM
Thanks @matt4446, i'll try it!