Some 'content types' refuse to load in WP FLathe Responsive Theme

Hi, first of all, thanks and well done for coming up with a great resource....if this particular approach matures I could se this being the future of e-learning for many of us!

Now to the problems.

Installation was fine as was loading all the content types. Here are the ones I am having problems with:

1. Boardgame -This simply refuses to load into the page when  [h5p id="1"] is inserted.  The strange thing is that the game works perfectly in the testing / editing part of wordpress....so it is something to do with the generated source code but I am not skilled enough to determine what is wrong and what i should do to get this particular content type playing! 

I have also noticed that there are three source codes to look at when visiting www.signweb.tv/boardgame

a) 'View Frame Source' - www.signweb.tv/boardgame   (but it is completely empty)
b) 'View Generated Source'
c)  'View source'

It is likely that the other content types I am having problems with will likely be ok once I determine the cause of this little hiccup.

If anyone can offer suggestions I'd be extremely grateful ...thanks, Mick

 


 

 

 

falcon's picture

Thanks for reporting. I'll look into this next week. We're finishing up some new content types at the moment.

To be honest I'm up against it as i want to showcase your product to my colleagues but as I have said, the current theme seems to be causing problems. In the meantime, is there Wordpress theme that you know off that works well with H5P content types..I am happy to change the theme temporarily as I just want to show some work.

Many thanks for getting back to me so quickly.

Mick

falcon's picture

The default theme works well with H5P!

falcon's picture

Ok, so the problem on  www.signweb.tv/boardgame seems to be that H5PIntegration.i18n haven't been defined yet when the first call to t is being made. Any reason for this beeing defined in $.ready icc?

Sorry mate, that level of detail is beyond me...I'm not a programmer and don't really understand too much about what is happening in the scripts etc....so in answer to your question..I have no idea - perhaps a plug in could have caused this?

Thanks for the prompt reply mate.

 

falcon's picture

:)

The question was for the user @icc, our Wordpress expert :)

icc's picture

Yes, in some themes the h5p-integration.js script will get loaded before the JS settings are printed. This is because different themes prints the script tags in different places.

In this case the issue seems to be caused by the fact that H5P's jQuery ready runs before the theme's jQuery ready. This might be because the theme uses a different jQuery than the default one in WordPress (which is not unusual).

The only real way I see of fixing the issues related to this is to make h5p-integration.js "start the show". Today h5p.js starts when H5P's jQuery ready fires, no matter the state of other components. This is an issue in Moodle as well, where H5P will start before YUI is ready with its translations. It would be much easier if YUI could just start H5P when YUI is ready.

For a quick fix in this particular case, it should be possible to just remove the "jQuery(document).ready(..." wrapper from h5p-integration.js, since the settings are set before the script runs. But it will not work on all other themes.

Thanks for taking the time to explain why things are going wrong!  I will try to see if I can implement the changes you recommend. I am not too bothered about getting the H5P content types to work on all themes.  If I could find one theme that displayed all of your content types correctly I would simply use that theme and all of my problems would be solved! Your colleague mentioned that the 'default' theme worked well, but i tried it and the boardgame still didn't load. So I am still interested to know, in your view, what is the best theme to guarantee compliance? Do I need to move away from Wordpress?

I apreciate your help.....it's agreat product you have here and it could/should go far! Perhaps you should build your own H5P theme for wordpress?

falcon's picture

I think also that we should follow MickyLuv's suggestion in another issue icc and test H5P with the most popular themes and add a compliancy list (and fix the problems with the non compliant themes)

icc's picture

What issue is that?
H5P is tested with a couple of different themes that has certain characteristics during development, default theme (Twenty Fourteen), one responsive (Mantra) and one without jQuery (Stripes and Blue). But should also be tested more popular themes before release.

I've created a new issue for fixing the integration problems with core (in our JIRA).

falcon's picture