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
Im really bad at razor, so bear with me.
Im just trying to render a simple image using the slimsy package
my imageattribute on the doc type is "imageID"
@if (imageID.HasValue("Image")) { var featureImage = Umbraco.Media(imageID.Image); <img src="@featureImage.GetResponsiveImageUrl(270, 161)" alt="" /> }
But i get the following error:
Compiler Error Message: CS0103: The name 'imageID' does not exist in the current context
on the first line of the above...
Hi Claus,
From what you've said, I think you need:
@if (CurrentPage.HasValue("imageID")) { var featureImage = Umbraco.Media(CurrentPage.imageID); <img src="@featureImage.GetResponsiveImageUrl(270, 161)" alt="" /> }
Jeavon
EXACTLY, thanks :)
Perfect, think I'll add a simpler example this this to the project page :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Simple rendering of slimsy image
Im really bad at razor, so bear with me.
Im just trying to render a simple image using the slimsy package
my imageattribute on the doc type is "imageID"
But i get the following error:
Compiler Error Message: CS0103: The name 'imageID' does not exist in the current context
on the first line of the above...
Hi Claus,
From what you've said, I think you need:
Jeavon
EXACTLY, thanks :)
Perfect, think I'll add a simpler example this this to the project page :-)
is working on a reply...