PDA

View Full Version : dax:trackartist vs. dax:trackcomposer



Balok
10-06-2006, 05:27 PM
Another question, if I may (for 6.0.1)

It appears that dax:trackartist returns a list of all those individuals who appear on the Track Properties sheet Credits page with the role of Lyricist. (It also returns those individuals who appear on the Album Properties sheet Credits page who are not assigned to any tracks - something that caused me some aggravation until I realized what I'd done.)

But dax:trackcomposer returns only what appears in the Composer dropdown on the Track Properties sheet General page. It ignores individuals who appear on the Track Properties sheet Credits page with the role of Composer. It seems to me that it should also return these individuals. Or is there another dax tag for this? I see nothing obvious in the list available in the template editor, but I admit I didn't test them all. I did discover dax:conductor, dax:soloist, and dax:orchestra but they return what I'd expect - not composers.

I notice that at least one of the iterator tags (dax:album) accepts arguments that permit the code to select a subset over which to iterate. Perhaps dax:author also works this way but if so I cannot find any documentation to suggest what arguments, order, etc. dax:author without arguments appears to return all those individuals who appear in the Track Properties sheet, Credits page, Authors and Performers list for the current track.

If not, may I suggest a future enhancement? A tag like dax:trackrole that accepts an argument permitting the code to select the role (or roles) of interest would be helpful for this sort of display. It could also accept an argument to select which of the lists (Authors and Performance, Production, Band Members, Guest Members) to iterate.

I don't want much, do I? :)

andrei_c
10-09-2006, 05:23 PM
It appears that dax:trackartist returns a list of all those individuals who appear on the Track Properties sheet Credits page with the role of Lyricist. (It also returns those individuals who appear on the Album Properties sheet Credits page who are not assigned to any tracks - something that caused me some aggravation until I realized what I'd done.)
Did you mean dax:trackauthor, right? Dax:trackartist refers to the artist of the track (Tracks page of Album properties). On the other hand, dax:trackauthor tag is no longer supported. Now it defaults to the entries in credits that lists lyricists, but it's just made for compatibility with previous version's templates.

For new templates, I recommend using new credit tags, like in this snippet from Default V6.dax:


<dax:author>
<p class="credititem"><dax:authorname/>
(<dax:authorrole/>)</p>
</dax:author>
Similarly, you can use dax:production (production credits), dax:member (band members), and dax:guest (guest musicians).

Andrei

Balok
10-10-2006, 05:12 PM
Sorry, I did mean dax:trackauthor. I'm modifying from the Crisp template which uses this tag to display only the lyricists of a song on the track page. I like this feature, but it sounds like it's not really available since dax:trackauthor is deprecated.

Is it possible to "call" dax:author, dax:member, dax:guest, and dax:production with any kind of argument if you only want certain roles? Is it possible to use dax:if and dax:authorrole together to somehow select a particular entry on the basis of what role it has been assigned?

Thanks.

andrei_c
10-11-2006, 08:37 PM
Is it possible to "call" dax:author, dax:member, dax:guest, and dax:production with any kind of argument if you only want certain roles? Is it possible to use dax:if and dax:authorrole together to somehow select a particular entry on the basis of what role it has been assigned?
No, there is no syntax for this. It's something to think about in
future...

Andrei

Balok
10-12-2006, 09:14 AM
No, there is no syntax for this. It's something to think about in
future...

Andrei
That's what I figured; I tried a bunch of different constructions and none of them worked.

I would be interested in that feature for some future release.

Thanks!

pheisholt
10-12-2006, 06:55 PM
I would think that you could pass the dax:authorrole to a javascript, and have the javascript perform different actions depending on the actual value of the dax:authorrole. If that is what you want to do.

Wadson
10-13-2006, 03:19 AM
Could you give an example script plse

pheisholt
10-13-2006, 02:10 PM
Well, you could add a function like this:

[fixed][color=green]function showRole(role)
{

Balok
10-18-2006, 06:36 PM
Could you give an example script plse

Here's what I did. First put this near the beginning of your track code somewhere - I stuck it right before the </head> tag:



<script language="javascript">
<!--
var composers = new Array;
var lyricists = new Array;
var songwriters = new Array;

function collectCredit(name,role)
{
switch (role.toLowerCase())
{
case "composer":
var o = new Object();
o.name = name;
o.role = role;
composers.push(o);
break;

case "songwriter":
var o = new Object();
o.name = name;
o.role = role;
songwriters.push(o);
break;

case "lyricist":
var o = new Object();
o.name = name;
o.role = role;
lyricists.push(o);
break;
}
}

function displayCredits(type)
{
// Display the credits, then dump the arrays for the next track. Display composers.
// If there are none, display songwriters and lyricists
if (composers.length > 0)
{
var o;
for (o in composers)
document.write("<i>" + composers[o].name + " (Composer)&amp;lt;/i><br>");
composers.length = 0;
}
else
{
if (songwriters.length > 0)
{
var o1;
for (o1 in songwriters)
document.write("<i>" + songwriters[o1].name + " (Songwriter)&amp;lt;/i><br>");
songwriters.length = 0;
}
if (lyricists.length > 0)
{
var o2;
for (o2 in lyricists)
document.write("<i>" + lyricists[o2].name + " (Lyrics)&amp;lt;/i><br>");
lyricists.length = 0;
}
}
}

-->
</script>


collectCredit builds arrays of credits. I was interested in three particular sorts of credits; it should be pretty obvious how to modify it for different credits.

displayCredits displays them. The reason I broke the two operations apart was part aesthetic: I wanted all the composers together, or all the songwriters, etc. The other part was that I wanted to display songwriters and lyricists only if there were no composers. This is a purely arbitary choice based on my approach, and you could easily change the logic here, too.

Then use this or something like it to call the code:



<dax:if(trackartist)>
<i>(<dax:trackartist/>)</i>
<dax:else>

<dax:author>
<script language="javascript">
<!--
collectCredit("<dax:authorname/>","<dax:authorrole/>");
-->
</script>
</dax:author>

<script language="javascript">
<!--
displayCredits();
-->
</script>
</dax:if>


Nothing too complex going on here. If there's an artist I display that entry and don't bother with the rest of it. If not, then I extract and display the other information. The <dax:author> tag is an iterator, as Andrei explained earlier. It's what lets me collect the information.

Doubtless this could be improved, but it runs in reasonable time for me and doesn't crash OCD, which is what I look for in a theme. :)

One improvement: if you don't like italics replace the <i> and </i> tags with <span class=xxxx> and </span> tags in the emitted code - the part inside the document.write call. Then define a style for xxxx using either the <style> tag or the CSS page in your theme. If you do it that way, someone could come along later and write a compatible external stylesheet to change it - see the 'Stylesheet' entry in the 'Theme' sheet of the 'Customize View' page. Get that page from the context menu most everywhere.

Hope that's useful to you.

Wadson
10-20-2006, 04:48 AM
pheisholt, Balok
Looks like scripts are too difficult for me