colorbox gallery with media field I am looking for a way (in D8) to create a colorbox gallery for a node field with multiple images but I am facing the following problems:


colorbox only works as an image field formatter (no media field formatter).
I would prefer media field since its nice to have entity browser to reuse some of the images.
Trying to create an image field that collects image using entity browser did not work for me. I was getting the error "The entity must be of type file" and none of the solutions seemed to work either. I even created a new entity browser but it did not succeed.
Media gallery and other related modules are not yet ported to Drupal 8


Is there any alternative?
I have finally managed to find a workaround which involves creating a view that displays the media field images based on contextual information from the node.  The field formatter can be changed to a view using views_field_formatter module 

Here is in a little more detail 

lets assume the content type that we want to have media gallery is named "gallery" and it contains a media field "field_media" and assume colorbox and views_field_formatter modules are installed and enabled


prepare a view that displays nodes of content type "gallery" (a block view is enough)
add relationship that exposes the field_media and call it "media"
add contextual filter "Content ID" based on "media" relationship
add appropriate image field to display (based on the "media"
relationship) and use colorbox formatter (since this field is an
image colorbox will be available)
go to the gallery content type display settings and configure the media field  to use the view prepared above passing as first parameter the node id