How to get the image url from Image Cropper and display in Surface Controller
I want to get the image url from image cropper, first I've replaced the default File upload property with an Image cropper property on my Image media type, and I'm using multiple media picker in my content node. I want to get the url of those images in my surface controller.
What I did is:
var searcher = new IndexSearcher(indexDirectory, true);
var masterQuery = new BooleanQuery();
TopDocs resp = searcher.Search(masterQuery, null, searcher.MaxDoc());
foreach (var scoreDoc in resp.ScoreDocs) {
var document = searcher.Doc(scoreDoc.doc);
var docsId = Umbraco.TypedContent(Convert.ToInt32(document.Get("id")));
var imageList = docsId.GetPropertyValue<string>("images").GetCropUrl(width: 329, height: 200);
}
but it gives me error:
'Cannnot implicitly convert type 'string' to 'System.Collections.Generic.List'
I've already watch the EP30 of Jeavon, but he didn't include on how to display it in SurfaceController
How to get the image url from Image Cropper and display in Surface Controller
I want to get the image url from image cropper, first I've replaced the default File upload property with an Image cropper property on my Image media type, and I'm using multiple media picker in my content node. I want to get the url of those images in my surface controller.
What I did is:
but it gives me error:
I've already watch the EP30 of Jeavon, but he didn't include on how to display it in SurfaceController
Anyone can help with me, I'm stuck
Jin
If it is 7.6 or newer try this
var imageList = docsId.GetPropertyValue
Hi John,
Thank you for reply, I've use 7.5.6.
I got an error.
My Controller:
My Model:
Jin
OK, sorry (my bad). The issue is the property images is a string, not a media item. GetCropUrl assumes you are working with media.
Take a look at a package called Slimsy, I think that will do what you want to do.
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.
Continue discussion