MediaWithCrops does not contain a definition for URL
t
Hi I don't know what I'm doing wrong for a simple task. I created a composition with a property for an image. Select Media picker as the type. I create a home page which has a master page listed and all the properties data come through fine when I do @Model.PageName But as soon as I use @Model.PageImage.Url() Or .GetCropUrl("cropName") I get the error "MediaWithCrops does not contain a definition for GetCropUrl and no accessible extension method accepting a first argument of type 'MediaWithCrops' could be found. I've checked versions and all versions are the same for Umbraco 13 but I don't why this is happening?
s
Hi, The GetCropUrl() method is part of the Umbraco.Extensions namespace. Did you include that in your view? (@using Umbraco.Extensions) As it is used all over the place, a good place to add this using is inside the _ViewImports.cshtml
117 Views