Examine search with media
# help-with-umbraco
t
Hi I'm using Examine search to retrieve content on my site. I've created the code which returns nodes and media items. Once I have all the results, to get the node I'm using Umbraco.Content(id); For media I can use Umbraco.Media(id); How are you guys displaying content and media on the page if both come back with results? Or is there a cleaner way to do this?
p
@User May I suggest “all” instead of "guys"? We use gender inclusive language in this Discord. 😀
l
Both Content and Media are IPublishedContent, so you could return the List to your View, loop through the list and check if the item is Content, render it on one way, or if Media render it another A good post here, its for Umbraco8 but the general principles are the same https://skrift.io/issues/examine-in-umbraco-8/
2 Views