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
Has anyone gotten the crop urls with razor? The 'Crops' property is empty.
I'm accessing my other properties simply like @sliderItem.Title, but @sliderItem.Crops is empty, eventhough umbraco.config shows a 'crops' node at the same level as 'Title'
I'm guessing I'll have to do the string manipulation on the original upload url
Maybe this can help you;
Your link ends up on a 500 server errror:
Error running Reader: SQL Statement:select id, domainName from umbracoDomainsException:System.Data.SqlServerCe.SqlCeException: The database file may be corrupted.
Sadly enough I have no control over that website. I was only pointing to a blog article...
@Chizzl's solution works well:
And now in MVC, it just needs this small edit to continue working:
<img src="@Model.Media.cropImage.crop.crops.Find("@name","mainPageImage").url" alt="what the" />
Hello sorry going round in circles, the above does not throw an error it displays the alt tag.
Don't really get the data type image cropper crops. I was expecting the image cropper to enable a new sized image to be created that could then be resaved with a different name in Media.
But as I understand it now the image cropper (with no ux clue that it has done so) saves the cropped information to an xml file called crop with attributes that you access using the word crops and the syntax .Find.
To use this new cropped image you then have to add some code to the template where you want the image to be placed referencing this crop file.
And now to my question, (if you are still with me!) I have been trying to use and understand what appears to be a very straight forward razor template from Chizzl's solution
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted