We've been trying to configure our jPlayer and views to create a smarter playlist (e.g. adding buttons to "Like" a track or remove it from the playlist, etc.) However, the jPlayer module erased all the relevant markup so that every entry was rendered as a single link (e.g. Name of song Like this song Remove from list)

We attempted to override the themeing functions, but all the markup had been long erased before it got there.

So we wrote a patch: The trim() and strip_tags() calls are now used on the label immediately before display instead of as soon as the markup is generated. This allows functions that override template_preprocess_jplayer_view_playlist to have access to less thoroughly "sanitized" markup. Unless, some theme functions are overridden, you should not see any changes in behavior.

I've heard that other people have been looking for something similar to this, so I figured I'd put this thing out here to see if it helps.

Comments

filipnest’s picture

I'm trying to get extra links (rules links, votes etc) to show up next to items in the views jplayer playlist but as mentioned all the markup is stripped and put into a single link label. I've tried this patch and also editing the template file but can't get the right variables in the template file or the fields to display any other way. There's a solution for Drupal 6 over at #981982: How to display other links/fields along with the actual mp3 link? which sounds close to perfect. Has anyone got this working with the Drupal 7 version who can point me to where I should be doing the themeing?

Many thanks in advance.

joestewart’s picture

rerolled to remove whitespace and handle htmlentities in the label