Multiple Content Sections on a Page

Jan 18, 2011 at 11:06 PM

Forgive me if I am totally missing something here, but is it possible to have a content type with more than one body part?  So I go to edit a page, fill in the body, and then have another rich text area for a secondary content area.

For example (and a shameless plug for my company), take a look at http://www.centare.com/services/.  There is a "What We Do" column and a "How We Do It" column.  If I were a content editor, I would expect to be able to edit the Services page, and see separate rich text boxes for "Left Column" and "Right Column".  It seems like the only way to do this is with widgets, but that is a hack because you would have to have a layer with logic for each page that is like this and make users edit content in 2 places (the page and the widget(s)).

Coordinator
Jan 18, 2011 at 11:32 PM

Not out of the box (except with some not so nice layer wizardry, like you said), but it should be fairly easy to build a multi-body part. This could be a good starting point:

http://orchardproject.net/docs/Creating-1-n-and-n-n-relations.ashx

You could associate each text zone with a zone name and have your module insert those there at runtime (widgets are not the only things that can go into zones). We actually had that feature a long time ago but had to remove it when we refactored the UI layer.

Jan 19, 2011 at 4:18 AM

In theory, as a hack, you could simply duplicate the body type with a new name if you just want a quick fix fast with a hard, fixed limit on the number of body blocks.

Coordinator
Jan 19, 2011 at 4:31 AM

No, that wouldn't work: only one part of a given type per content item

Jan 19, 2011 at 10:41 PM

When I said hack, I truly meant a dirty hack: Creating a new body type all together (ie Body2) that could then be added as a unique type to a content item.

Feb 16, 2011 at 2:24 PM

I also have the need for this, I need to create a content type that has 3 Content/Body sections, widgets and layers wont work as I need this in a list.

My initial idea is to create a "Body Field" I'm kind of supprised that Body is not actually a field to begin with... can someone please out line the reasion so for this?

If I create a body field will this work?

- Will the performance including search be acceptable with the Html content data stored in XML in the DB? (I know its not ideal!)

- Will the Html content data actually store correctly in the DB (Html inside XML)?

- Any other considerations?

Coordinator
Feb 16, 2011 at 7:26 PM

Html could be a decent field. Body, not so much.

If you create such a field, you should name it Html or rich text, not body. The html could be stored inside xml, encoded or in a cdata section.

Another thing you could do, which would probably work better, is to create a part with multiple html editors. With each editor, you could associate a choice of zone and a position.