Can I bypass the H5P hub for authoring in Drupal 7 ?

Colin D's picture
Forums: 

I am developing a Drupal 7 site which will involve users authoring content using a custom H5P content type. Currently, they need to interact with the H5P hub and select this custom content type before they can begin authoring. I would like to streamline the process (as users will never need to select another content type from the hub). Can anyone advise how I might bypass the hub?

Perhaps I could create a javascript that simulates a click on the content type list item as soon as the hub loads? Is there a better way? Any help is much appreciated.

 

Many thanks,

Colin  

Hi Colin, in Drupal h5p there is option to turn off the hub under /admin/config/system/h5p which then just displays a dropdown list of available content types (from whatever you have installed) but I'm not sure how you could make it automatically select the content type you want. If you find a method I'd be interested to hear it as we will be trying to do the same thing soon too.

Colin D's picture

@macscruffs I ended up achieving this by modifying h5peditor-editor.js just after the line 17 which reads library = library && library != 0 ? library : ''; 

I just set library equal to a string representing the library I want: library = 'H5P.customLib 2.0';

Hope that helps.