List H5P content type used in drupal views

Forums: 

I have a view that lists all nodes that use h5p. I would like to include the type of h5p content used (i.e. the name or title of the h5p library used) in two ways:

1. just as plain text to display in the view

2. as a views exposed filter to allow the user to filter by library

Currently, the only field that is usefull is 'H5P content: Library ID'. When I include this field, only the id of the library used is displayed.

I can write a switch statement so that I can deal with this data on client side:

switch (libid) {
  case '25':
    h5pLibName = 'Interactive Video';
    break;
  case '32':
    h5pLibName = 'Single Choice Set';
    break;
  case '59':
    h5pLibName = 'Interactive Presentation';
    break;
  }
}

 

But I'm hoping there is a way to include the name of the library in my view using a better way.

Using H5P for Drupal 8.

icc's picture

Sadly, the libraries are not an entity so this doesn't come automatically, and it will be a good deal of work to fix that. But I think if someone can do some custom views integration code then we can include that in the module.

Is there any other way to display library name(title) in view?