Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I'm very new to umbraco and Razor, so i hope someone can help me.
I have a document type with a property called "image" which has a type Upload
What i want to do is when the image property is emtey it will not be displayed on the browser. and when it has a value it will be displayed.
Hi Høgni and welcome to Our!.
Something like this should work for you
@{ if(Model.HasValue("image")){ <img src="@Model.Image"/> } }
Hope this will help you to display your image
/Dennis
Hi and welcome to Our!
You find an example of using an upload editor here but you may find that a media picker is more appropriate?
Jeavon
Hi guys... I figured it out myself :) but thank you
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Display image none Razor
Hi
I'm very new to umbraco and Razor, so i hope someone can help me.
I have a document type with a property called "image" which has a type Upload
What i want to do is when the image property is emtey it will not be displayed on the browser. and when it has a value it will be displayed.
Hi Høgni and welcome to Our!.
Something like this should work for you
@{
if(Model.HasValue("image")){
<img src="@Model.Image"/>
}
}
Hope this will help you to display your image
/Dennis
Hi and welcome to Our!
You find an example of using an upload editor here but you may find that a media picker is more appropriate?
Jeavon
Hi guys... I figured it out myself :) but thank you
is working on a reply...