Image not appearing from a Content Part with a Media Picker Field

夙愿已清 提交于 2019-12-11 13:17:32

问题


I am trying to achieve the carousel and have got so far except not being able to show the image. The sample can be found here http://www.stevetaylor.me.uk/image-carousel-using-twitter-bootstrap-and-orchard-cms-projections.

To replicate do the following:

1.Create a new content type a. Creatable b. Add Fields i. Field Name: Image; Type: Media Picker; ii. Field Name: Priority ; Numeric Field

2.Go to Admin>>Content. I would expect to see both the Image Url and Priority Value. However only see the Priority Value.

3.Create a project of the content type and list them on the home page using the default layout and same occurs only the Priority field is showing but no image.

I am running a fresh install of 1.6.1 with no extra modules.


回答1:


The media picker field is not displayed in the Summary view by default. See this response to a similar question:

How to add Image Field to Blog Post Summary in Orchard CMS?

In short you need to add the following to your placement.info file:

<Match DisplayType="Summary">
  <Place Fields_MediaPicker="Content:1"/>
</Match>

...and to display in admin list, include in the admin theme placement file:

<Match DisplayType="SummaryAdmin">
  <Place Fields_MediaPicker="Content:1"/>
</Match>

Orchard's docs on placement: http://docs.orchardproject.net/Documentation/Understanding-placement-info



来源:https://stackoverflow.com/questions/17157197/image-not-appearing-from-a-content-part-with-a-media-picker-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!