The Hero property is an Image Cropper, as stated in the Slimsy example description. Excerpt from the modelbuilder generated file:
[ImplementPropertyType("hero")]
public Umbraco.Core.PropertyEditors.ValueConverters.ImageCropperValue Hero => this.Value<Umbraco.Core.PropertyEditors.ValueConverters.ImageCropperValue>("hero");
yet, this expression:
@Url.GetSrcSetUrls(Model.Hero, 323, 300)
gives me this error:
Error CS1503: Argument 2: cannot convert from 'Umbraco.Core.PropertyEditors.ValueConverters.ImageCropperValue' to 'Umbraco.Core.Models.PublishedContent.IPublishedContent'
What am I missing? May be I am misunderstanding this sentence of the example description:
Use this method for setting the crop dimensions in your Razor code,
assumes your image cropper property alias is "umbracoFile"
I don't know what that sentence means in relationship to the example.
I figured out my misunderstanding. I needed to use a MediaPicker on the docType, not an ImageCropper. Now it works. May be the Slimsy example description should be clarified. I will send you a PR.
Also, thank you for your input on Our about how to use immage cropper with items in media (your answer here). With this information, I will be able to get it to work as intended. Very cool.
Umbraco 8.5.3: GetSrcSetUrls: cannot convert from ImageCropperValue to IPublishedContent
I am starting to use Slimsy 3.0.0-beta3. I am on Umbraco 8.5.3.
I am kind of copying the first Slimsy example on GitHub like so:
The
Hero
property is an Image Cropper, as stated in the Slimsy example description. Excerpt from the modelbuilder generated file:yet, this expression:
gives me this error:
What am I missing? May be I am misunderstanding this sentence of the example description:
I don't know what that sentence means in relationship to the example.
I am grateful for input - thank you!
Jeavon,
I figured out my misunderstanding. I needed to use a MediaPicker on the docType, not an ImageCropper. Now it works. May be the Slimsy example description should be clarified. I will send you a PR.
Also, thank you for your input on Our about how to use immage cropper with items in media (your answer here). With this information, I will be able to get it to work as intended. Very cool.
Best regards! Mikael
is working on a reply...