简体   繁体   English

如何在Orchard CMS的LatestBlogPost小部件中添加图像

[英]how add image in RecentBlogPost widget, Orchard CMS

In Blog Post Content Type i have Media Library Picker Field named "BlogPostImage". 在博客文章内容类型中,我具有名为“ BlogPostImage”的媒体库选择器字段。 In placement.info i add: <Match ContentType="BlogPost"> <Match DisplayType="Summary"> <Place Fields_MediaLibraryPicker="Content:1"/> </Match> </Match> <Match ContentType="BlogPost"> <Match DisplayType="Summary"> <Place Fields_MediaLibraryPicker="Content:1"/> </Match> </Match>我添加: <Match ContentType="BlogPost"> <Match DisplayType="Summary"> <Place Fields_MediaLibraryPicker="Content:1"/> </Match> </Match>

So picture show in summary page, i wanna that the same picture show in Recent Blog Widget. 所以图片显示在摘要页面中,我想在最近的博客小部件中显示相同的图片。 How do that? 怎么办

You have to override the shape template. 您必须覆盖形状模板。 In views\\Parts.Blogs.RecentBlogPosts.cshtml 在views \\ Parts.Blogs.RecentBlogPosts.cshtml中

See example from this theme : https://bitbucket.org/psenechal/pjs.bootstrap a MediaPickerField called BlogPostImage is used in views\\Content-BlogPost.Summary.cshtml 请参见此主题的示例: https ://bitbucket.org/psenechal/pjs.bootstrap views \\ Content-BlogPost.Summary.cshtml中使用了一个称为BlogPostImage的MediaPickerField。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM