Hello guys.. I'm trying to figure out how to get the URL of the uploaded image from the image cropper (not any of the pre-made crops, but the whole image) in Razor.
I've been using this:
@Model.Value("image")
When I use this with the @ symbol inside of an HTML tag, it returns just the URL. That works fine for me.
BUT when I use this inside of a block of code and try to assign it to a variable, it returns a lot of other stuff with it (focal points, all the crops and so on)..
I absolutely don't understand what's going on and why. How can I SIMPLY get a URL of an image.
This is what I'm trying to do:
if (@Model.TemplateId == 1167)
{
imageUrl = String.Format("{0}?width=1280&height=640&mode=pad", Model.Value("image"));
}
I don't have the models builder setup and I'm using Umbraco 8.1.2
How to get url from the image cropper
Hello guys.. I'm trying to figure out how to get the URL of the uploaded image from the image cropper (not any of the pre-made crops, but the whole image) in Razor.
I've been using this:
When I use this with the @ symbol inside of an HTML tag, it returns just the URL. That works fine for me.
BUT when I use this inside of a block of code and try to assign it to a variable, it returns a lot of other stuff with it (focal points, all the crops and so on)..
I absolutely don't understand what's going on and why. How can I SIMPLY get a URL of an image.
This is what I'm trying to do:
I don't have the models builder setup and I'm using Umbraco 8.1.2
Hi,
Please can you try.
Hope this helps to solve the issue.
Cheers,
Shaishav
With this code I get an error:
The type or namespace name 'iPublishedContent' could not be found (are you missing a using directive or an assembly reference?)
This cool guy helped me in a Facebook group, so I have a solution.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.