Conditional CSS with H5PMods?

Forums: 

 

Hi, newbie here. I really like H5P.  Lurking for awhile. So I got the H5PMods working on my Wordpress site.  very cool. 

I am trying to use a Switch/Case based field to pull in a dynamic CSS file based on something in the Title field or some Tag of an Interactive Video.  

ex.

'ABC' in the Title of my content points to ABC.css

'DEF' in the title my content points to DEF.css

Is there any way to query the title to drive the Switch/Case within the  'h5pmods_alter_styles' function?

Thanks for any ideas.

John

 

Summary: 
Conditional CSS with H5PMods?
icc's picture

Hi John,

Actually, this is not possible but I can see how it would be a useful feature.
What you could do as a workaround is to add a .js file through alter_scripts and then use that to check the title and apply the custom styling. It will be a bit more advanced but you should be able to achieve what you want.