solved How to show different artist name?

Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
I have two members already, asking for this ability. They want to post different artist names than their own, to the songs they are uploading.

One is a songwriter who has various other people record his songs. One is a radio station that wants some of it's artists in an on demand playlist. In both cases they have permission.

To accommodate them, I tried creating another field in the song upload form form for artist name, but it was just ignored and the account holders name still is being shown.

So how can I give them this ability?


--

Ken Rich
indiegospel.net

updated by @ken-rich: 02/15/15 03:35:02PM
michael
@michael
11 years ago
7,772 posts
Ken_Rich:...I tried creating another field in the song upload form form for artist name, but it was just ignored and the account holders name still is being shown....

You mean You added an additional field 'artist_name' to the audio create and audio update forms, then changed the {jrCore_list } function to list or search by 'artist_name' and it didn't work for you?

Which templates did you change and what did you change them too? Thanks.
paul
@paul
11 years ago
4,335 posts
If you use the form designer to add in a field, say 'audio_alternative_artist', you need to modify the template, so basically, add {$item.audio_alternative_artist} to the template where you want it to show.


--
Paul Asher - JR Developer and System Import Specialist
brian
@brian
11 years ago
10,148 posts
Could they just do something like:

Artist Name: Song Name

as the song name? It would work and be simple.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
Hi Brian,

Well the thing is, then it would be.

Profile Name: Artist Name: Song Name (since the profile name is added no matter what currently).

So what they are asking, is to hide the profile name and have a place to enter an artist name instead.

I'm trying to install what Paul suggested right now...


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
michael:
Which templates did you change and what did you change them too? Thanks.

D'OH - I was supposed to change templates too? lol
jpg
 •  42KB




--

Ken Rich
indiegospel.net

updated by @ken-rich: 12/10/14 02:25:24PM
brian
@brian
11 years ago
10,148 posts
I'm not sure why it would be Profile name first - the profile name is not currently included in the audio list title.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
paul:
If you use the form designer to add in a field, say 'audio_alternative_artist', you need to modify the template, so basically, add {$item.audio_alternative_artist} to the template where you want it to show.

Will it show in the player? The problem is that whatever is uploaded is automatically tagged "by Profile Owner", because it assumes the account holder is the artist.

So I'm thinking what's required is probably a little more complicated, like an "if, else" substitution wherever it is the player get's the name from.

Like "if alternative artist >1 use that, else use normal profile name" but in the proper place with the proper coding.


--

Ken Rich
indiegospel.net
paul
@paul
11 years ago
4,335 posts
Quote: Will it show in the player?
It can do. Players are also built by templates (look in the jrAudio or jrVideo template folders) so your custom field could be shown there instead of 'profile_name'


--
Paul Asher - JR Developer and System Import Specialist
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
brian:
I'm not sure why it would be Profile name first - the profile name is not currently included in the audio list title.

Hi Brian,

It's actually not first it's behind it on the player (see attached).

There is no place on the upload form for artist name, so whatever you upload is automatically by "Profile Name".

This is an actual case. George Wells is the profile owner and songwriter. He is uploading it but wants to put the artist name who is actually performing it.

If he puts it with the song title, it's still going to say by George Wells in the player.
george.JPG.jpg
george.JPG.jpg  •  29KB




--

Ken Rich
indiegospel.net

updated by @ken-rich: 12/10/14 02:48:11PM
brian
@brian
11 years ago
10,148 posts
Got it - yeah since the audio tracks would technically be part of the profile, that would be correct...


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
11 years ago
10,148 posts
You could also consider putting these users to a Power User quota and letting them create additional profiles for these other artists (if they are going to be uploading a lot of tracks by different artists).


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
Yes I already thought of the power user thing. However, this is an 84 year old guy who's not computer savvy. He's got a load of songs migrated over and it would be taxing on him if he had to reload them all, and keep track of a bunch of profiles to boot.

I got a similar situation with someone else. Need a simple workable solution.


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
paul:
Quote: Will it show in the player?
It can do. Players are also built by templates (look in the jrAudio or jrVideo template folders) so your custom field could be shown there instead of 'profile_name'

OK - studying this out thanks a bunch...


--

Ken Rich
indiegospel.net
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Ken_Rich:However, this is an 84 year old guy who's not computer savvy.
If I were you I'd avoid altering my templates for such a user.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
Ok - it looks like this is the template:
modules/jrAudio/templates/jrAudio_player_dark.tpl

and this is the pertinent code

 {if $a._item.$ext == 'mp3'}
            {
                title: "{$a.title}",
                artist: "{$a.artist}",
                mp3: "{$jamroom_url}/{$a.module_url}/stream/{$params.field}/.....
                
       

So the question becomes - how do I tell it to substitute {$item.audio_alternative_artist} for {$a.artist} if it's filled in, otherwise default to profile owner as normal?


--

Ken Rich
indiegospel.net

updated by @ken-rich: 12/10/14 04:24:55PM
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
SteveX:
Ken_Rich:However, this is an 84 year old guy who's not computer savvy.
If I were you I'd avoid altering my templates for such a user.

Hi Steve,

He's not the only one requesting this, and I can see it being useful for others down the road too. Industry reps for instance, and "The Love Offering Tour" account which has submissions from various artists, not all of them members.


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
So does this if, then statement (cloned from elsewhere) solve this, or is it going to break my network?

  {if $a._item.$ext == 'mp3'}
            {
                title: "{$a.title}",
                artist: "{if strlen($item.audio_alternative_artist) > 0}
                    {$item.audio_alternative_artist}
                {else}
                   {$a.artist}
                {/if}",
                mp3: "{$jamroom_url}/{$a.module_url}/stream/{$params.field}/.....



--

Ken Rich
indiegospel.net
michael
@michael
11 years ago
7,772 posts
That should work. try it.

Use the template editor in the ACP and you can always go back if it breaks.
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
OK - thanks Michael. I'll give it a whirl.


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
michael:
That should work. try it.
Use the template editor in the ACP and you can always go back if it breaks.

Nope... It didn't work... The name disappeared off of all my players, and there was a short bar through the controls (almost like the CSS was screwed up)???

Hmmmmm.....

This was the actual code used
 artist: "{if strlen($item.audio_alternate_artist) > 0}
                    {$item.audio_alternate_artist}{else}{$a.artist}{/if}",

Here is a screenshot of the form field.
Form.JPG.jpg
Form.JPG.jpg  •  81KB




--

Ken Rich
indiegospel.net

updated by @ken-rich: 12/11/14 05:39:01AM
paul
@paul
11 years ago
4,335 posts
Does $item.audio_alternate_artist exist in that template? It may be part of the $a array.
Put in a {debug} to see what you have.


--
Paul Asher - JR Developer and System Import Specialist
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
I'm sorry Paul, I don't know how to put in a debug. I'm not familiar with what you are talking about, although I gather it's some type of trouble shooting technique.

I seem to be good at adding bugs, not debugs lol


--

Ken Rich
indiegospel.net
paul
@paul
11 years ago
4,335 posts
https://www.jamroom.net/the-jamroom-network/documentation/development/1477/debug


--
Paul Asher - JR Developer and System Import Specialist
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
Thanks Paul - I'll have a look ASAP.


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
I've watched that a couple times now and tried to absorb it. I can see how it would help in knowing what's available by default, but how can it be applied to this situation?

I mean, we are trying to add something new that isn't available by default, so I wouldn't expect it to show up in a debug.

Unless it's supposed to show up AFTER the form field is made, and running debug is to test whether the form is making it available?

At any rate, I'm making my Ning site a redirect to the JR5 version tomorrow, and so I have to concentrate on fixing dead links, writing FAQs, customer support, redoing advertising, that sort of thing.

I can see where learning some basic programmers tricks will be useful long term, but right now I just need a quick fix until I have more time to study.


--

Ken Rich
indiegospel.net

updated by @ken-rich: 12/13/14 09:17:42AM
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
I still have two clients waiting for this and haven't managed to figure it out yet.

My last attempt was I ran the debug like Paul suggested. I see my new form field is giving me a value:
 audio_alternate_artist => "Ja Ja Binks"

I can also see the value I am trying to swap it with:
artist => "Indie Gospel"

The problem is when I go to the template and substitute them, it doesn't show. So the original is:
 artist: "{$a.artist}",  

I substitute:
 artist: "{$a.audio_alternate_artist}",  

I don't know what $a. stands for but I've tried it with and without it. Perhaps it has to be substituted with something else? Perhaps they are not in the same array?

I don't know but the data is available, I just don't know how to tell the template to display it. Any ideas?


--

Ken Rich
indiegospel.net

updated by @ken-rich: 12/22/14 08:22:09AM
paul
@paul
11 years ago
4,335 posts
I'm not sure where the 'a' has come from either. In most Jamroom templates that would be 'item'.
The original song artist would have been displayed with {$item.profile_name} so look for that and change it to {$item.audio_alternate_artist}

btw - what template are you editing?


--
Paul Asher - JR Developer and System Import Specialist
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
Hi Paul,

The template is jrAudio_player_dark.tpl

It seems that I am changing the right place, because the artist name disappears from the player.

{$item.profile_name} doesn't appear to be an option. Instead, this seem to be the relevant section in context.

"artist:" seems to be the value to be modified.

  {if is_array($media)}
        {foreach $media as $a}
            {if $a._item.$ext == 'mp3'}
            {
                title: "{$a.title}",
                artist: "{$a.audio_alternate_artist}",               
                mp3: "{$jamroom_url}/{$a.module_url}/stream/{$params.field}/{$a.item_id}/key=Hi9yH4xXiXFK/file.mp3",
                {if strstr($formats, 'oga')}
                oga: "{$jamroom_url}/{$a.module_url}/stream/{$params.field}/{$a.item_id}/key=Hi9yH4xXiXFK/file.ogg",
                {/if}
                poster: "{$jamroom_url}/{$a.module_url}/image/audio_image/{$a.item_id}/large"
            },
            {/if}



--

Ken Rich
indiegospel.net

updated by @ken-rich: 12/22/14 09:31:47AM
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
paul:
I'm not sure where the 'a' has come from either. In most Jamroom templates that would be 'item'.
The original song artist would have been displayed with {$item.profile_name} so look for that and change it to {$item.audio_alternate_artist}

I've tried writing it as {$item.audio_alternate_artist} but that is invisible the same as every other attempt I've made. I'm still not getting anywhere with this one.


--

Ken Rich
indiegospel.net
michael
@michael
10 years ago
7,772 posts
{if is_array($media)}
        {foreach $media as $a}
{debug}
            {if $a._item.$ext == 'mp3'}
            {
                title: "{$a.title}",
                artist: "{$a.audio_alternate_artist}",               
                mp3: "{$jamroom_url}/{$a.module_url}/stream/{$params.field}/{$a.item_id}/key=Hi9yH4xXiXFK/file.mp3",
                {if strstr($formats, 'oga')}
                oga: "{$jamroom_url}/{$a.module_url}/stream/{$params.field}/{$a.item_id}/key=Hi9yH4xXiXFK/file.ogg",
                {/if}
                poster: "{$jamroom_url}/{$a.module_url}/image/audio_image/{$a.item_id}/large"
            },
            {/if}

add a {degbug} into that loop. You need to check that $a contains 'audio_alternate_artist' do a search in the debug panel that pops up (ctrl+f) for the term 'audio_alternate_artist'. If its there, then you can use it. If it isn't nothing will show up.
updated by @michael: 01/06/15 09:49:55PM
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
michael:
                title: "{$a.title}",
                artist: "{$a.audio_alternate_artist}",               
                mp3: "{$jamroom_url}/{$a.module_url}/stream/{$params.field}/{$a.item_id}/key=Hi9yH4xXiXFK/file.mp3",
                

add a {debug} into that loop. You need to check that $a contains 'audio_alternate_artist' do a search in the debug panel that pops up (ctrl+f) for the term 'audio_alternate_artist'. If its there, then you can use it. If it isn't nothing will show up.

Hi Michael,

I'm so glad you jumped in here - I am still being asked for this feature, but can't get it working after many attempts.

I don't know by looking at the debug results if $a contains the term, but the term is in the overall list. When adding it in the simplest form as you have in the code example, the term does not show in the player.

Please refer to the attached screenshot.
artist name.JPG.jpg
artist name.JPG.jpg  •  128KB




--

Ken Rich
indiegospel.net

updated by @ken-rich: 01/06/15 10:48:56PM
michael
@michael
10 years ago
7,772 posts
yeah that's the issue. 'artist' is on a level 1 higher than audio_alternative_artist is.

try:
artist: "{$a._item.audio_alternate_artist}",
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
michael:
yeah that's the issue. 'artist' is on a level 1 higher than audio_alternative_artist is.

I tested on my Sandbox site and it's working now. Also, I added back the code I was initially trying to perform the "swap" with, and it's working like a charm. Thanks, going to be some "happy campers" with this one lol

artist: "{if strlen($a._item.audio_alternate_artist) > 0}
                    {$a._item.audio_alternate_artist}{else}{$a.artist}{/if}",



--

Ken Rich
indiegospel.net
michael
@michael
10 years ago
7,772 posts
That's it. You're getting the hang of it now. Nice one. :)
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
I now have the code working in the audio/video players, and the album players - but not playlists.

For it to work in the playlist players, I need to tweak the code somehow to account for songs and videos being in the same player at the same time. I know how to make it work for one or the other, but not both.

I need something that says, if it's a song run this:

artist:  "{if strlen($item._item.audio_alternate_artist) > 0}
                    {$item._item.audio_alternate_artist}{else}{$item.artist}{/if}",

If it's a video, run this:

 artist: "{if strlen($item._item.video_alternate_artist) > 0}
                    {$item._item.video_alternate_artist}{else}{$item.artist}{/if}",

Perhaps coded somewhat like this, but with the proper statement for (playlist file=video/audio)

 artist: "{if strlen($item._item.video_alternate_artist) > 0} && (playlist file = video)
                    {$item._item.video_alternate_artist}{elseif strlen($item._item.audio_alternate_artist) > 0} && (playlist file = audio)
                    {$item._item.audio_alternate_artist}{else}{$item.artist}{/if}",

Does that make sense? If it's close enough to see what I'm trying to do, can someone please enlighten me as to the proper way to code it - thanks.


--

Ken Rich
indiegospel.net
michael
@michael
10 years ago
7,772 posts
artist: "{if strlen($item._item.video_alternate_artist) > 0} 
                    {$item._item.video_alternate_artist}{elseif strlen($item._item.audio_alternate_artist) > 0} 
                    {$item._item.audio_alternate_artist}{else}{$item.artist}{/if}",

try that.
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Hi Michael,

I have reconfirmed that the separate audio and video codes both work in the playlist player, but the "elseif" mash-up of them doesn't. It results in a broken CSS (see screenshot).
playlist.JPG.jpg
playlist.JPG.jpg  •  38KB




--

Ken Rich
indiegospel.net

updated by @ken-rich: 01/07/15 11:21:07PM
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Hi Michael,

I tried it again, this time removing all spaces between brackets and it works - awesome!!!
Thanks very much...


--

Ken Rich
indiegospel.net

updated by @ken-rich: 01/10/15 07:56:20PM