Modifying Orchard to have an Excerpt field?

Topics: Customizing Orchard
Jul 2, 2012 at 12:02 AM

I am currently using Blog Engine 2.6 and would like to migrate to Orchard.  As I investigate the migration, one issue is that BE has an Post Excerpt field. This is optional and if not filled out then the first x number characters of the post are used. However I fill it out short text and typically place an image in the post excerpt. So then in the post list view i have the short text and the image. Clicking the Title i go to the details page which has the post in its entriety and usually video. I dont need or want the image to appear in the details. I want to have 2 separate fields - post excerpt and post text which i guess is the bodyHtml.

How can i modify orchard to have a excerpt field, use a RTE for the excerpt as well, insert the excerpt and show the excerpt? Thank you

Coordinator
Jul 2, 2012 at 12:50 AM

Create a part or add a field for the excerpt. You can then override the template for the summary to use the new part or field when it exists.

Jul 2, 2012 at 1:42 AM
bertrandleroy wrote:

Create a part or add a field for the excerpt. You can then override the template for the summary to use the new part or field when it exists.


Can you elaborate on the part about overriding the template? Where do i do this - in source or in the dashboard?

Coordinator
Jul 2, 2012 at 2:26 AM

In your theme. Use the shape tracing feature from Designer Tools if you're uncertain how to do it: it will create alternate files for you. You can also take this as an inspiration source or to get you started: http://weblogs.asp.net/bleroy/archive/2012/07/01/my-body-summary-template-for-orchard.aspx

Jul 3, 2012 at 12:43 PM

So using the shape tracing it is possible tomodify Orchard to achieve the look as illustrated below:

 Admin page - creating a new post has a rich text editor for excerpt and post

 And then below is the index view that shows the excerpt with a image

Belwo is the details page of the post which does not have the image but shows the embedded video. This  is the kind of layout I want to achieve.

 

Developer
Jul 3, 2012 at 10:18 PM

The Shape Tracer will help you identify shapes and create template files for available alternates. The layouts you have shown are perfectly doable using Orchard and Shape Tracing.