The item you are using must be a variable you are declaring somewhere above. Check for a line like this: var item = ...
The Model is the object that get's passed into your view and holds the data you want to display. In case of Umbraco, it's usually an IPublishedContent wrapping the data of your content node.
If you wan't to know more about how MVC and Razor works check these Links:
Just a note for future reference: there will be problems with certain properties due to them being obsolete, see quick notes below, and for more details please take a look at here;
If you are upgrading an old website, check if you are using obsolete
properties in your Data Types and change them to their updated
counterparts. The migration will fail if you are still using obsolete
properties!
The updated properties are:
Content Picker Media Picker Member Picker Multinode Treepicker Nested
Content Folder Browser Related Links You can see if your site is using
the obsolete properties by the (Obsolete) prefix in their name.
Umbraco 8 Media picker
Hello,
I've moving a small website over manually from umbraco 7 to 8 and having issues with media picker.
Here was my code in umbraco 7 which doesnt seem to work now in 8.
I've now changed it to the following and it still doesn't display any images, I get no errors.
Thanks
Hi Matt,
not sure if this might be a typo but shouldn't it be
item.Value<IPublishedContent>("blobImage")
instead ofModel.Value...
?~ Jonathan
Hello Jonathan,
Thanks for that, that worked a treat.
No wasn't a typo, I was just using this code as a guide;
https://our.umbraco.com/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Media-Picker/
Whats the difference in me using Item or Model?
Thanks
Hi Matt,
glad to here it's working!
The item you are using must be a variable you are declaring somewhere above. Check for a line like this:
var item = ...
The Model is the object that get's passed into your view and holds the data you want to display. In case of Umbraco, it's usually an IPublishedContent wrapping the data of your content node.
If you wan't to know more about how MVC and Razor works check these Links:
https://www.tutorialsteacher.com/mvc/mvc-architecture
https://www.tutorialsteacher.com/mvc/razor-syntax
For more information about how Umbraco works with Razor take a look at this:
https://our.umbraco.com/documentation/Reference/Templating/Mvc/views
https://our.umbraco.com/documentation/Reference/Querying/IPublishedContent/
~ Jonathan
Just a note for future reference: there will be problems with certain properties due to them being obsolete, see quick notes below, and for more details please take a look at here;
is working on a reply...