I have a weird issue where my ArticleImage content doesn’t always load. I’ll do my best to explain it. So we have Articles that each have a required “ArticleImage” media picker. When accessing this from the main listings the image loads consistently, however, accessing it through either the CMS or a carousel of latest articles the image doesn’t load, it just returns null.
I can’t get my head around why this nulls the image as if you go through the normal route the image loads, and after that has been loaded the other routes also have the image.
Let me know if I need to post more code or explain more!
So the first part works, and clicking on it triggers the article.Url() which sends you to the article page where it hits snippet 2 and in that one the @image.GetCropUrl(620, 350)&format=webp doesn’t resolve to a url - is that correct?
The thing is that using those links to access the ArticlePage view seems to null the image. The cropped image URLs are working for everything correctly and only ArticlePage seems to be having the trouble.
So essentially, accessing the article via the main listing page works fine, image always loads. However, using featured articles, or selected article carousels or even umbraco’s own node link results in no image loading. Honestly I’m baffled XD I appreciate the help looking into it though
Oh I see where I’ve been confusing, it’s only in the ArticlePage.cshtml where the image is tempermental. It works 100% if it is called anywhere else and uses the same methods as the rest of the site, but in other views it’s always 100% working.
It is likely not the image itself that is temperamental but rather either some model casting gone wrong or the Umbraco context not being available in the instances it cannot load.
If you can narrow down when exactly it happens and add some checks for model types in your code you could narrow down if that is the cause or not.
If the Umbraco context can’t be created it is likely something with custom routing setups.