As noted in other issues, I have been playing around with the jplayer module code. the other patches were peripheral, but this one has the guts of what I have been trying to do. However I am not sure I'm on the right track.

The issue I wanted to address was to support multiple jPlayer skins, configurable in the field display settings, with a minimum of modification to those provided in the jPlayer distro. I posted a long comment under the circle player thread on this... and then decided to have a go.

The area I'm unsure of is how to link up the theming to the template files. That is, how to go from a theme() call to a .tpl.php file, without limiting what else can be on the page or whether the tpl is provided by jplayer module or something else.

My 'best' idea so far is what I've done in the attached patch: when registering the module's themes, discover the known skins and add in theme function names that include the skin name. So instead of theme('jplayer',...) you might end up with theme('jplayer_pink_flag', ...), or something like that.

I also note that jplayer seems to suffer from the template bug in D7: the value of the 'template' attribute should match the name of the theme component, so we should have:
array('jplayer' => array('template' => 'jplayer', ...)
not
array('jplayer' => array('template' => 'theme/jplayer', ...)
.. at least that's my understanding.

I'm not sure that this is the 'drupal way' or whether there are simply better ways of achieving this. Any help appreciated.

CommentFileSizeAuthor
#1 jplayer-skinning-support.diff7.1 KBrivimey
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rivimey’s picture

This is my current patch... I know it doesn't work!!

markie’s picture

Status: Active » Closed (duplicate)

Can we combine all theming issues into https://www.drupal.org/node/2485867. Thanks.

markie’s picture