1
votes

I have a document type with a media picker property. The property have alias "bannerimage". Now i am trying to get hold of the image url in my template.

I am using the GetMediaURL-method to fetch the image url, but all i get is an error. The trace gives me The type or namespace name 'GetMediaUrl' does not exist in the namespace 'Umbraco' (are you missing an assembly reference?)

Here is my code

<umbraco:Macro runat="server" language="cshtml">
<img src='@Umbraco.GetMediaUrl(DynamicModel.bannerimage, "uploadedFile")' alt="Banner"/>
</umbraco:Macro>

Umbraco version is 4.11.3.

1

1 Answers

2
votes

If I remember correctly, GetMediaUrl was an Umbraco5 method. As such, I don't think it exists in the 4.11 dlls.

umbraco.library.GetMedia or Library.MediaById should be accessible, though.