Useful addition to AudioPlayer.xsl template

Discuss the powerful Explorer Templates used in the CAT programs
Post Reply
Salvatore Besso
Posts: 9
Joined: Tue Aug 15, 2017 11:33 am

Useful addition to AudioPlayer.xsl template

Post by Salvatore Besso » Sun Dec 02, 2018 1:19 pm

I have made a small addition to the AudioPlayer.xsl template whose purpose is to show the correct release year:
  • If track year is different than album year, shows the track year
  • If track year is equal to album year, shows the album year
  • If track year and album year are undefined (empty), shows "Unknown"
I hope it could be useful.

Code: Select all

New code for track/album/unknown year:

<!-- !SB -->
<!-- ======================================== -->
<!--      Album or track release year         -->
<!-- ======================================== -->
<xsl:choose>
    <!-- Album and track year unknown -->
    <xsl:when test="/data/record/trackdata/released/@year='' and /data/record/albumdata/released/@year=''">
        <xsl:text>Unknown year (Track &amp; album)</xsl:text>
    </xsl:when>
    <xsl:otherwise>
        <xsl:choose>
            <!-- If album and track year are different, show track year... -->
            <xsl:when test="/data/record/trackdata/released/@year!=/data/record/albumdata/released/@year and /data/record/trackdata/released/@year!=''">
                <xsl:value-of select="/data/record/trackdata/released/@year"/>
                <xsl:text> (Track)</xsl:text>
            </xsl:when>
            <!-- ...otherwise show album year... -->											
            <xsl:otherwise>
                <xsl:value-of select="/data/record/albumdata/released/@year"/>
                <xsl:text> (Album)</xsl:text>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:otherwise>
</xsl:choose>
<!-- ======================================== -->
<!--             End of Addition              -->
<!-- ======================================== -->
<!-- SB! -->

insert immediatly after:

        <a href="TrackList_Songwriter.xsl?Title={/data/record/trackdata/title}@validate=yes,2,3@orderby=artist,title@xslparam:doctitle={/data/fld/track/title/@name}: {/data/record/trackdata/title}" target="_blank">
            <img border="0" src="GoToPage.gif"/>
        </a>
    </td>
</tr>

it should be inserted immediatly after row 106 in the original template
Best wishes
Salvatore

User avatar
Alex Ivanovich
Posts: 311
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

Re: Useful addition to AudioPlayer.xsl template

Post by Alex Ivanovich » Mon Dec 03, 2018 8:52 am

Thank you ;)

you italian? :)

Salvatore Besso
Posts: 9
Joined: Tue Aug 15, 2017 11:33 am

Re: Useful addition to AudioPlayer.xsl template

Post by Salvatore Besso » Mon Dec 03, 2018 4:16 pm

Alex Ivanovich wrote:
Mon Dec 03, 2018 8:52 am
Thank you ;)

you italian? :)
yes, Trieste.
Best wishes
Salvatore

User avatar
Alex Ivanovich
Posts: 311
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

Re: Useful addition to AudioPlayer.xsl template

Post by Alex Ivanovich » Mon Dec 03, 2018 4:27 pm

Salvatore Besso wrote:
Mon Dec 03, 2018 4:16 pm
Alex Ivanovich wrote:
Mon Dec 03, 2018 8:52 am
Thank you ;)

you italian? :)
yes, Trieste.
anche io ;)
ma il nome Salvatore e' del sud Italia :)

Salvatore Besso
Posts: 9
Joined: Tue Aug 15, 2017 11:33 am

Re: Useful addition to AudioPlayer.xsl template

Post by Salvatore Besso » Mon Dec 03, 2018 5:45 pm

Alex Ivanovich wrote:
Mon Dec 03, 2018 4:27 pm
Salvatore Besso wrote:
Mon Dec 03, 2018 4:16 pm
Alex Ivanovich wrote:
Mon Dec 03, 2018 8:52 am
Thank you ;)

you italian? :)
yes, Trieste.
anche io ;)
ma il nome Salvatore e' del sud Italia :)
not exactly
Best wishes
Salvatore

User avatar
Alex Ivanovich
Posts: 311
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

Re: Useful addition to AudioPlayer.xsl template

Post by Alex Ivanovich » Mon Dec 03, 2018 7:19 pm

Da Wikipedia :D

Code: Select all

Questo nome si riscontra un po' in tutta Italia, 
anche se risulta maggiormente accentrato nel Sud e nelle isole come in Sicilia, 
della stessa regione sono anche specifiche le varianti come "Turi", "Ture", "Turiddu", Salvo e Sasà

Post Reply