Navigation:  CATraxx FAQ > Upgrading to the latest version >

Explorer templates

Previous pageReturn to chapter overviewNext page

If you want to use your own customized explorer templates from version 8 you need to make some modifications (for example to display the new genre field). Another options is to install the new templates, and then re-apply your customizations to the standard templates.

The CATraxx setup program will ask if you want to install the new explorer templates that ship with CATraxx v9. If you answer yes, your old template folder is backed up.

Note: You can download a zip file with the new templates from here (catraxx9_xsl.zip).


UTF-8

All templates should be updated to use UTF-8 encoding. To do this, change

<?xml version="1.0" encoding="iso-8859-1"?>

to

<?xml version="1.0" encoding="utf-8"?>

and make sure you also save the file with UTF-8 encoding.

You can use this little program to do this automatically (back up your templates first!): ConvertTemplatesToUTF8.exe. Just click the ... button, select the \Explorer Templates folder, then click OK.


Index

Due to the number of changes required in the Index.xsl ("home page") template, we recommend you use the three new index templates: Index.xsl, Index_PlayHistory.xsl and Index_Statistics.xsl (available in the zip file).


Styles

We recommend you use the new Style.css file you find in the zip file.


GIF files

We recommend you use the updates GIF files you find in the zip file.


Item => Disc

To display the tracks on an album you need to replace "item" with "disc", "itemno" with "discno" and "items" with "disccount" in the following templates: Album_Tracks.xsl, AlbumBrowse.xsl, AlbumBrowse_Right.xsl, ArtistPerson_Albums_Details.xsl and Index.xsl.

 

For example, replace

<xsl:apply-templates select="item"/>

with

<xsl:apply-templates select="disc"/>

 


Genre

To display the new multi-genre field, first add this section in Common.xsl (this is a shared function that the other templates will call):

<xsl:template name="format-genre">
<xsl:param name="genrelist"/>
<xsl:param name="hyperlink" select="'True'"/>
<xsl:param name="newwindow" select="'False'"/>
<xsl:param name="newline" select="'True'"/> 
<xsl:param name="separator1" select="' / '"/>
<xsl:param name="separator2" select="' / '"/>
<xsl:param name="setgenre_table" select="''"/>
<xsl:param name="setgenre_recordid"/>
<xsl:param name="settrackgenre" select="'False'"/>
<xsl:param name="settrackgenre_albumid" select="-1"/> 
<xsl:param name="settrackgenre_trackid" select="-1"/>
<xsl:param name="templatefile" select="''"/>
<xsl:for-each select="$genrelist/genre">
   <xsl:choose>
     <xsl:when test="$hyperlink='True'">
       <xsl:choose>
         <xsl:when test="$templatefile='IMAGECAROUSEL'">
           <A HREF="CMD:IMAGECAROUSEL:Album,Image1,-1,{/data/record/albumdata/albumid/@unformatted},True,True,0,1,Play Album,{.},Album.Genre={.}"><xsl:value-of select="."/></A>
         </xsl:when>       
         <xsl:when test="$newwindow='True'">
           <A HREF="Genre.xsl?ID={@id}" TARGET="_BLANK"><xsl:value-of select="."/></A>
         </xsl:when>
         <xsl:otherwise>
           <A HREF="Genre.xsl?ID={@id}"><xsl:value-of select="."/></A>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:when>
     <xsl:otherwise>
       <xsl:value-of select="."/>
     </xsl:otherwise>
   </xsl:choose>
   <xsl:if test="$setgenre_table!=''">
     <xsl:text> </xsl:text>
     <A HREF="CMD:SETGENRE:{$setgenre_table},Genre,{$setgenre_recordid},{@id},{position()}">
       <IMG SRC="SetGenre.gif" BORDER="0"/>
     </A>   
   </xsl:if>
   <xsl:choose>
     <xsl:when test="$newline='True'">
       <xsl:if test="position() &lt; last()">
         <BR/>
       </xsl:if>
     </xsl:when>
     <xsl:otherwise>
       <xsl:if test="position() &lt; last() -1">
         <xsl:value-of select="$separator1"/>
       </xsl:if>
       <xsl:if test="position() = last() -1">
         <xsl:value-of select="$separator2"/>
       </xsl:if>        
     </xsl:otherwise>
   </xsl:choose>
</xsl:for-each>
<xsl:if test="$setgenre_table!=''">
   <xsl:if test="count($genrelist/genre) > 0">
     <BR/>
   </xsl:if>
   <A HREF="CMD:SETGENRE:{$setgenre_table},Genre,{$setgenre_recordid},-1,-1">
     <IMG SRC="SetGenre.gif" BORDER="0"/>
   </A>  
   <xsl:if test="$settrackgenre='True' and count($genrelist/genre) > 0">
     <xsl:text> </xsl:text>
     <A HREF="CMD:SETTRACKGENRE:{$settrackgenre_albumid},{$settrackgenre_trackid}">
       <IMG SRC="SetGenreTracks.gif" BORDER="0"/>
     </A>     
   </xsl:if>
</xsl:if> 
</xsl:template>

To display the new genre field, replace the old code with a call to "format-genre". For example, in AlbumBrowse.xsl, replace

<A HREF="AlbumList.xsl?FullGenre={fullgenre}@xmltitle=Genre: {fullgenre}" TARGET="_BLANK">
<xsl:value-of select="fullgenre"/>
</A>
<A HREF="CMD:SETGENRE:Album,Genre,{albumid/@unformatted}">
<IMG SRC="SetGenre.gif" BORDER="0"/>
</A>
<xsl:if test="fullgenre!=''">
<A HREF="CMD:SETTRACKGENRE:{albumid/@unformatted},{fullgenre/@id}">
<IMG SRC="SetGenreTracks.gif" BORDER="0"/>
</A>

with

<xsl:call-template name="format-genre">
<xsl:with-param name="genrelist" select="genrelist"/>
<xsl:with-param name="newwindow" select="'True'"/>                 
<xsl:with-param name="setgenre_table" select="'Album'"/>
<xsl:with-param name="setgenre_recordid" select="albumid/@unformatted"/>
<xsl:with-param name="settrackgenre" select="'True'"/>
<xsl:with-param name="settrackgenre_albumid" select="albumid/@unformatted"/>
</xsl:call-template>           

You need to update the following templates: Album.xsl, AlbumBrowse.xsl, AlbumBrowse_Right.xsl, ArtistPerson.xsl, ArtistPersonBrowse.xsl, Playlist.xsl, PlaylistBrowse.xsl, PlaylistBrowse_Right.xsl, PlaylistList.xsl, Track.xsl, TrackBrowse.xsl and TrackBrowse_Right.xsl. Download catraxx9_xsl.zip, and use the code from the relevant xsl file.

Replace "fullgenre" with "genre" in the following templates: Genre.xsl, GenreBrowse.xsl, GenreList.xsl and Index.xsl.


In addition to this, you will also have to add code to display the new data fields (for example Music Chart and Box Set). Use the code from the zip file with the new templates.