GetCropUrl, combine named crop and specific width
# help-with-umbraco
p
Hello, in templates and partials for a Umbraco 13 based website, I currently render images like this ex
<img src="@image.GetCropUrl(width: 1200, height: 675 )" />
This works well, and so does using pre-defined and named crops like
<img src="@image.GetCropUrl("square")" />
What I really want is to combine the named crop with a specific width. A simple combination does not work, e.g.
<img src="@image.GetCropUrl("square", width:600)" />
Combining would give my editors the option to create perfect crops for a few formats like "tall", "wide", and "square", while the cshtml could use those crops in a large array of sizes for srcsets. Can this even be done? What would be the correct syntax?
m
maybe
.GetCropUrl(cropAlias: "square", width: 600);
p
Of course 🙃 This works. Thanks for helping. #rookiemistakes
7 Views