0
I have no real need for the individual song page and would prefer it if clicking the block of the song played it instead of going to the song page.
Can this be done with a quick code change on my part?
Can this be done with a quick code change on my part?
Responses (11)
-
Accepted Answer
0Never mind. I figured it out myself:
In components/com_muscol/templates/template_song.php:
Change line 20 from
<tr class="song-item" {{#if isplayable}}data-isplayable{{/if}} data-id="{{id}}" data-type="song" itemprop="track" itemscope itemtype="http://schema.org/MusicRecording">
to
<tr class="song-item" {{#if isplayable}}data-isplayable{{/if}} data-id="{{id}}" data-type="song" itemprop="track" itemscope itemtype="http://schema.org/MusicRecording" onclick="play_song(jQuery(this));" data-id="{{id}}">
and change line 35 from
<a class="templateSongLink" href="/{{link}}"><div class="name" itemprop="name">{{name}}</div></a>
to
<div class="name" itemprop="name">{{name}}</div>
-
Accepted Answer
-
Accepted Answer
0Nope - I did figure it out!
Don't edit line 20, leave it as it is.
Change line 22 from
<td class="song">
to
<td class="song" onclick="play_song(jQuery(this));" data-id="{{id}}">
and change line 28 from
<div class="playPauseSongBtn" onclick="play_song(jQuery(this));" data-id="{{id}}"></div>
to
<div class="playPauseSongBtn"></div>
This makes the song play or stop when you click anywhere up to the duration. You still need to change line 35 as above.
I'm a bit disappointed at the "support" paying customers get. -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
0Any thoughts on this? I've left it non-functioning for you to see and I'd rather not leave it that way for long.-
Germinal Campsmore than a month agoI'm checking it. I haven't found a solution yet. Not sure why when you put the code on the main element, only the first song plays.
-
-
Accepted Answer
0By the way, here's the code as it is at the moment, just to make sure I haven't made a silly error somewhere:
<tr class="song-item" {{#if isplayable}}data-isplayable{{/if}} data-id="{{id}}" data-type="song" itemprop="track" itemscope itemtype="http://schema.org/MusicRecording">
<td class="song" onclick="play_song(jQuery(this));" data-id="{{id}}">
<div class="song-image-wrapper" style="background: url('data:image/jpg;base64,{{base64_img}}') center / cover;">
<meta itemprop="image" content="{{thumbnail_src}}" />
<div class="imagediv" style="background: url('/{{thumbnail_src}}') center / cover;"></div>
<?php if (JFactory::getUser()->authorise('muscol.displayplayer', 'com_muscol') ) { ?>
{{#if isplayable}}
<div class="playPauseSongBtn"></div>
{{/if}}
<?php } ?>
</div>
Your Reply
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »