(plus the proper <> around the img tag) used to work in Version 6 just fine. Now, in Umbraco 7, it doesn't. It's returns empty and gives the server fits.
It's a Upload Datatype with the name of courseLogo. When I look at the documentation for the Upload DataType - ,http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/Property-Editors/Built-in-Property-Editors/Upload it references "umbracoFile" as the name I'm supposed to be using. But how can I do that when I have 2 upload fields on the same page. They both can't be named umbracoFile.
Upload Datatype - How do I do this is in Umbraco 7? - Same code works perfectly fine in 6
@if (Model.Content.GetPropertyValue("courseLogo").ToString().Length > 0)
{ img src="@Model.Content.GetPropertyValue }
(plus the proper <> around the img tag) used to work in Version 6 just fine. Now, in Umbraco 7, it doesn't. It's returns empty and gives the server fits.
It's a Upload Datatype with the name of courseLogo. When I look at the documentation for the Upload DataType - ,http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/Property-Editors/Built-in-Property-Editors/Upload it references "umbracoFile" as the name I'm supposed to be using. But how can I do that when I have 2 upload fields on the same page. They both can't be named umbracoFile.
Hi lonehorseend,
To me it looks like that you are trying to print the image from the Upload Datatype, but only if the field is not empty.
You can do it this way:
The HasValue checks that the field is not empty.
Hope this helps, if I have misunderstood your question, don't hesitate to write again,
/Dennis
is working on a reply...