Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
yesterday I was building my new web (Umbraco 6.0.5) and found a bug when writing my template. I want the logo of my site to be changable on the Home node, so I created a media picker property on my Frontpage document type with the Alias "logoImage". Somewhere in my template I had this:
<img src="@Umbraco.Media(Umbraco.Field("logoImage", recursive: true)).Url" alt="Logo"/>
This resulted in a YSOD (Exception Details: System.InvalidOperationException: The value of parameter 'id' must be either a string or an integer). When omitting the recursive:true, though, or switching to CurrentPage.logoImage, it works (well, as long as I don't open up a sub-page).
For the moment I found a workaround though, by adding a .ToString() to the Umbraco.Field, making it:
<img src="@Umbraco.Media(Umbraco.Field("logoImage", recursive: true).ToString()).Url" alt="Logo"/>
But of course this is not how it's supposed to be like :)
Please help, my recursive true in Umbraco 7.0 is not working. My case is :-
<div class="innerBannerWrap" style="background-image:url(@Umbraco.Media(@Umbraco.Field("industriesBgImage", recursive: true).ToString()).Url)">
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted