As you can see I do
news.GetCropUrl(propertyAlias: "bild", height: 300, width: 400)
Now I don't show that, but that works... 100% but that is not using my defined crop but rather just a height and width.
My problem is in the watch window (debugger) below.
When I try to ask for my cropAlias it returns null. I have also tried just
GetCropUrl("bild", "myAlias") and that did not work either.
So on the line below you see I get the image as property and there you can see on the line Value that towards the end the "crops" is empty.
This seems to be my problem, even tho everything should be set up correctly.
As a final thing I am showing the whole code for the Controller, should anyone be interested. It's the lower half (under News) that is of interest, the upper part works fine.
You are right, to use the predefined crop it should be like this:
GetCropUrl(propertyAlias:"bild", cropAlias:"myAlias")
Double check that your aliases are both correct
Image cropper gives blank crops in controller
So I am using an Image cropper which is set up like so: https://db.tt/uzTZyTWL
Then I put that picker on my News document type.
Then I go ahead and create a news item like so https://db.tt/xJ9qT2Ei
As can be seen there, there is a great looking cropped image.
Now here is where my problems start, I prefer many things in pre-populated view models and then I use "Route hijacking" to populate them.
This screenshot shows my problem https://db.tt/WEPZPcpq
As you can see I do news.GetCropUrl(propertyAlias: "bild", height: 300, width: 400) Now I don't show that, but that works... 100% but that is not using my defined crop but rather just a height and width.
My problem is in the watch window (debugger) below. When I try to ask for my cropAlias it returns null. I have also tried just GetCropUrl("bild", "myAlias") and that did not work either.
So on the line below you see I get the image as property and there you can see on the line Value that towards the end the "crops" is empty.
This seems to be my problem, even tho everything should be set up correctly.
As a final thing I am showing the whole code for the Controller, should anyone be interested. It's the lower half (under News) that is of interest, the upper part works fine.
https://db.tt/T1EXQzQO
You are right, to use the predefined crop it should be like this: GetCropUrl(propertyAlias:"bild", cropAlias:"myAlias") Double check that your aliases are both correct
So now that you answered that I went back there and guess what, the same Watch now reported my alias.
Before I had another bug and cleared all temp data and republished everything.
So most likely there was something problematic there that was cleared at the same time.
Hurrah!
is working on a reply...