Skip to content

Commit ca03259

Browse files
Update sample
1 parent 8d82857 commit ca03259

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Umbraco.Docs.Samples.Web/Property-Editors-Add-Values/CreateImageCropperValuesController.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,16 @@ public ActionResult<string> CreateImageCropperValues()
4848
// Serialize the image cropper value
4949
var cropperValue = JsonConvert.SerializeObject(cropper);
5050

51+
// Get the alias of the 'cropper' property
5152
var testCropperAlias = Product.GetModelPropertyType(_publishedSnapshotAccessor, x => x.TestCropper)?.Alias;
5253

5354
// Set the value of the property with alias 'cropper'
5455
if (content != null && !string.IsNullOrWhiteSpace(testCropperAlias))
5556
{
57+
// Set the value of the cropper
5658
content.SetValue("testCropper", cropperValue, "en-US");
5759

60+
// Set the value of the cropper using the 'testCropperAlias' variable
5861
content.SetValue(testCropperAlias, cropperValue, "en-US");
5962
}
6063

0 commit comments

Comments
 (0)