如何显示媒体选择器图像 [英] How can I display a Media picker image

查看:26
本文介绍了如何显示媒体选择器图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

抱歉,这可能是一个新手问题,但我对 Umbraco 很陌生.

Sorry this might be a newbie question but I am quite new to Umbraco.

我在文档类型上设置了媒体选择器,一切正常.所以我去模板输入

I have a media picker set up on a document type, and it all works fine. So I go to the template and enter

 @Umbraco.Field("bottomRightLarge")

这只给了我图像的 ID,我怎样才能让它显示用户选择的实际图像?我正在使用 UMBRACO 7 - 我已经尝试过 http://our.umbraco.org/projects/website-utilities/social-bookmarking-button/general-discussions/19360-Displaying-an-image-from-Media-Picker-in-a-web-page - 但 XSLT ERRORS 错误时间.

this only gives me the ID of the image, how can I get this to show the actual image the user has selected? I am using UMBRACO 7 - and I have tried http://our.umbraco.org/projects/website-utilities/social-bookmarking-button/general-discussions/19360-Displaying-an-image-from-Media-Picker-in-a-web-page - but the XSLT ERRORS bug time.

推荐答案

这对我有用

<umbraco:Macro runat="server" language="cshtml">
<img src="@Model.MediaById(Model.topleftsmall).umbracoFile" alt=""/>
</umbraco:Macro>

请注意,我是在 Firefox 20.0.1 上尝试此操作的,但保存无法正常工作.

please note I was trying this on firefox 20.0.1, and the save just didnt work properly.

这篇关于如何显示媒体选择器图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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