Umbraco.TypedContent() is null, though id exists...
I've scoured the documentation and just can't figure out why this doesn't work. I'm making a system for displaying puppy litters. I can loop through all the litters in the system. A litter has a sire, and I can get the ID of that sire, which is 1413. But If I then try to load it with Umbraco.TypedContent(sireID), it comes back null and I can't display any of its properties. What am I doing wrong? This is in a partial view.
Umbraco.TypedContent() is null, though id exists...
I've scoured the documentation and just can't figure out why this doesn't work. I'm making a system for displaying puppy litters. I can loop through all the litters in the system. A litter has a sire, and I can get the ID of that sire, which is 1413. But If I then try to load it with Umbraco.TypedContent(sireID), it comes back null and I can't display any of its properties. What am I doing wrong? This is in a partial view.
are you sure it is published? try republishing and see if that helps -- or is it in the recycle bin?
I'm positive it's all published. I went and made sure of it.
Hi Bobby,
2 questions,
1) What version of Umbraco are you using?
2) Are Property Value Converters enabled?
Thanks,
Nik
Bob Baty-Barr helped me figure it out offline. I wasn't casting the calls using IPublishedContent.
Here is the correct line for Line 21:
I'm using the new content and media pickers, so it looks like casting the pickers is required.
I'm using v7.11.0
I wasn't even looking at the documentation on the pickers, just trying to display content.
Thanks again Bob for the help!
is working on a reply...