Playlist button for all musics of an Artist

Nmaster88
Nmaster88
@nmaster88
8 years ago
94 posts
What i want to do is:
I have a section were i have artists and each artist has a "add to playlist button".
When the user clicks this button, i want it to open the playlist dialog box, but instead of adding only one music i want it to add all musics of that artist. (or a limited number of musics of that artist)
How can i do this?

I'm trying using the variations of the function jrPlaylist button without success
{jrCore_module_function function="jrPlaylist_button" playlist_for="jrAudio" image="plus_circle.png" class="circleplus_icon_playlist" title="Add To Playlist"}


updated by @nmaster88: 05/31/16 11:19:47PM
michael
@michael
8 years ago
7,715 posts
making a playlist is a one-at-a-time thing, so if you're wanting to build a way to add 'all this artists music' then you're going to need to build you're own function.

Docs: "Defining your own SMARTY function"
https://www.jamroom.net/the-jamroom-network/documentation/development/1569/defining-your-own-smarty-function

It will probably look like this in the templates:
{nmSomething_add_to_playlist profile_id=$profile_id}

Then in your defined smarty function do a search on the profile id for all the songs and run a foreach loop over the songs and add each to a users playlist.

Take a look inside the:
/modules/jrPlaylist/include.php

file for all the functions available, there's probably something that will do the inclusion for you.

Otherwise you can build the playlist structure thats expected and put that into the playlist modules datastore directly from your module.

Tags