如何在 Orchard CMS 的博客文章摘要中添加图像字段? [英] How to add Image Field to Blog Post Summary in Orchard CMS?

查看:40
本文介绍了如何在 Orchard CMS 的博客文章摘要中添加图像字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望在我的 Orchard 站点上的博客文章摘要中显示图像字段.它当前显示在博客文章本身但不在摘要中.如何将其添加到摘要中?

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?

推荐答案

部件和字段的显示在每个模块中的placement.info 文件中定义.假设您正在使用 Contrib.ImageField 模块中的图像字段,您将需要覆盖摘要显示类型(在 Modules\Contrib.ImageField\Placement.info 中定义)的字段的默认位置,默认情况下为:

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>

您可以通过将以下内容添加到主题的placement.info 文件中来实现此目的(请注意,我已将其限制为仅用于 BlogPost 内容类型)例如

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>

这会在内容"区域中显示 BlogPost 内容项摘要视图的图像.有关果园安置的更多信息,请参见 http://docs.orchardproject.net/Documentation/Understanding-展示位置信息

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

这篇关于如何在 Orchard CMS 的博客文章摘要中添加图像字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆