I have a Master template which has the header and footer for each page.
Each page thereafter is rendered inside that Master template using @RenderBody().
In the Hompage Model I have a media picker using multiple images.
I can call the media picker on the homepage but not on any other page
Works on hompega eusing the following
@{ var typedMultiMediaPicker = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("asscoiates_logos_slider");
foreach (var item in typedMultiMediaPicker)
{
var URL = item.GetPropertyValue<string>("imageURL");
<div>
<a href="@URL" target="_blank"><img src="@item.Url" alt="" /></a>
</div>
}
}
When displaying from a page that is not the homepage i get error
System.NullReferenceException: Object reference not set to an instance of an object.
Im thinking its because the properties are set on the homepage therefore works on home page.
Otherwise : How do I do recursive with multiple images with media picker.