I have a content type that has a media field that can contain audio, video or image, I created a view and I want to filter the view depending on the media type is that possible using Drupal views or do I need to make custom code for this
1 Answer
You can add more info about the referenced Media in your content Views through a Relationship for that Media field.
Add the Relationship (under Advanced Views settings) called something like Media referenced from field_mixed_media under the Content
Category.
You can Require it if you only want to see nodes that have that Field filled in (not empty).
Once you add that Relationship you will see more options when adding new Fields and Filters.
In your case you'll want to add the Filter Media type from the Media
Category, it will use the Relationship by default, and Expose it.
The Exposed filter will show as a drop-down select list. If you want it display as checkboxes you can use the Better Exposed Filters module.
type
property forMedia
already.