3
votes

Looking to display the Image Field in the Blog Post Summary on my Orchard site. It current displays on the blog post itself but not in the summary. How do I add it to the summary?

2

2 Answers

7
votes

The display of parts and fields is defined in the placement.info files found in each module. Assuming you're using the Image Field from the Contrib.ImageField module, You will need to override the default placement of the field for the summary display type (which is defined in Modules\Contrib.ImageField\Placement.info) which by default is:

<Match DisplayType="Summary">
  <Place Fields_Contrib_Image="-"/>
</Match>

You can do this by adding the following to your theme's placement.info file (note I have restricted this to the BlogPost content type only) e.g.

<Match ContentType="BlogPost">
  <Match DisplayType="Summary">
    <Place Fields_Contrib_Image="Content"/>
  </Match>
</Match>

This displays the image in the Content zone for the summary view of BlogPost content items. For more info on placement in Orchard see http://docs.orchardproject.net/Documentation/Understanding-placement-info

0
votes

You can use the Media Library Picker Field. I did the following steps to add image field to blog summary:

  1. add Media Library picker field to Blog-Post content Type

  2. then in the placement.info add the following

    <Match ContentType="Blog">
      <Match DisplayType="Summary">
        <Place Part_Image_Summary="Content">
     </Match>
    </Match>