Hello. There are 2 small typos in audio_playlist.theme. I noticed them because they messed up my layout. Probably don't worth a patch though:
function theme_audio_playlist_body($node) {
global $user;
$items = $node->audio_playlist_items;
$image = $node->playlist_info['image_url'] ? '<a href="'.$node->playlist_info['image_url'].'" target="_blank"><img src="'.$node->playlist_info['image_url'].'"></a>' : "";
$playlist = "\n<ol>\n";
if (count($items) > 0) {
foreach ($items as $item) {
$audio_file = node_load($item);
$download = $audio_file->audio_fileinfo['downloadable'] ? l("(download)", $audio_file->url_download) : "";
$playlist .= "<li>". audio_get_player($audio_file) . " ". $audio_file->title ."<small>". l(" (info)", "node/$audio_file->nid") . " ". $download ." </small>" . "</li>\n";
}
} else {
$manage_link = node_access('update', $node, $user->uid) ? l(' <small>[manage '. AUDIO_PLAYLIST_NAME .']</small>', 'node/'. $node->nid .'/manage', array(), null, null, FALSE, TRUE) : '';
$playlist .= t('No tracks have been added yet. ' . $manage_link);
}
$playlist .= "</ol>\n";
//$playlist = theme('fieldset', array('#value' => $playlist, '#title' => 'Tracklist'));
$output = "\n<div class=\"audio-playlist-body\">\n";
// Typo in original: <div class="clear" />
// Divs are not self-closing
$output .= $image . t('<div class="audio-playlist-listing"><h2>Tracklist:</h2>') . $playlist .'</div><div class="clear">'. $node->body;
$output .= "</div>\n";
// Forgot to close div.audio-playlist-body
// An extra </div> is needed here
$output .= "</div>\n";
return $output;
}
Excellent module, thanks for sharing.
Comments
Comment #1
zirafa commentedHi,
I fixed the div.clear problem...although I don't see the second problem.
Both div.audio-playlist-body and div.audio-playlist-listing have closing divs, so I don't believe an additional one is necessary. You might be overlooking the closing div that is on the same line as
<div class="audio-playlist-listing">.Updated in CVS and HEAD.
Comment #2
zirafa commentedComment #3
ditek commentedHi Zirafa,
As far as I see it, the closing div that is on the same line as
Comment #4
ditek commentedOops. My HTML got nixed from the text. What I wanted to say was that the div that you mention is actually closing the div.audio-playlist-listings on the very same line.
E.
Comment #5
zirafa commentedRight. Isn't that what we want? The idea is that the $image variable actually contains a floating div image, and the listing is floating as well. I fixed it so that the "clear" is not
. Then on the next line it closes div.audio-playlist-body. I think the difference is I decided to close div.clear, and not wrap $node->body with it. This should work, I believe. It essentially leaves div.clear as an empty element.<div class="clear"></div>instead ofComment #6
ditek commentedTried it with my layout, it does work.
I often see br class="clear" used in Drupal. It's a few bits less than an empty div...:)
Comment #7
(not verified) commented