MG 2.2 Marking unviewed media items

Orit

Active member
I'm looking for a way to mark unviewed media items (like in the thread_list, where the title is in bold if the thread is unread)
I noticed the mediaItem entity has a Viewed relation.
How can I use it to check if the media item was viewed by the current user?

Thanks!
 
In case anyone else needs this:
I added a class to the div like this:
HTML:
<div class="{{$mediaItem.Viewed.{$xf.visitor.user_id} ? 'isViewed' : '' }}"></div>
 
Back
Top Bottom