Custom XSL

Discuss the powerful Explorer Templates used in the CAT programs
Peerli
Posts: 30
Joined: Sun Sep 06, 2015 3:54 pm

Custom XSL

Post by Peerli » Mon Jun 08, 2020 3:47 pm

Hello.
I want to display the year next to Original by in Explorer.
The text field is the field "Custom30" and I renamed it in the properties.
amii.jpg
amii.jpg (30.63 KiB) Viewed 184 times
properties.jpg
properties.jpg (58.88 KiB) Viewed 184 times

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<?data type="record"?>
<?data table="track"?>

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:include href="Common.xsl"/>

<xsl:param name="doctitle">
  <xsl:call-template name="format-artist">
    <xsl:with-param name="artists" select="/data/record/trackdata/artists"/>
    <xsl:with-param name="hyperlink" select="'False'"/>
  </xsl:call-template>	
  <xsl:text> / </xsl:text>
  <xsl:value-of select="/data/record/trackdata/title"/>
</xsl:param>

<xsl:param name="playlist_doctitle">
  <xsl:text>Playlists including: </xsl:text>
  <xsl:call-template name="format-artist">
    <xsl:with-param name="artists" select="/data/record/trackdata/artists"/>
    <xsl:with-param name="hyperlink" select="'False'"/>
  </xsl:call-template>	
  <xsl:text> - </xsl:text>
  <xsl:value-of select="/data/record/trackdata/fulltitle"/>
  <xsl:text> / </xsl:text>
  <xsl:value-of select="/data/record/albumdata/title"/>
</xsl:param>

<xsl:template match="/">
  <html>
  <head>
  <title><xsl:value-of select="$doctitle"/></title>  
  <link rel="stylesheet" type="text/css" href="style.css"/>
  </head>
  <body>
    <table class="record_pane_table_outer" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top" width="155">        
          <xsl:choose>
            <xsl:when test="data/record/albumdata/image1/@virtual='No'">
              <a href="CMD:VIEWIMAGE:Album,{data/record/albumdata/albumid/@unformatted},1"><img border="0" width="150" 

src="{data/record/albumdata/image1/filename}" class="record_pane_image2"/></a>
            </xsl:when>
            <xsl:otherwise>
              <img border="0" width="150" src="{data/record/albumdata/image1/filename}" class="record_pane_image2"/>
            </xsl:otherwise> 
          </xsl:choose>      
        </td>
        <td valign="top" width="40%">
          <table class="record_pane_table" cellspacing="1" cellpadding="0">
            <tr> 
              <td class="record_pane_table_group" colspan="2">Main / General</td>
            </tr>
            <tr>
              <td class="record_pane_table_group_padding" colspan="2"></td>
            </tr>         
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/title/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <a href="Track.xsl" target="_blank"><xsl:value-of select="data/record/trackdata/fulltitle"/></a>
                <xsl:call-template name="format-audiosample">
                  <xsl:with-param name="audiosample" select="data/record/trackdata/audiosample"/>
                  <xsl:with-param name="trackid" select="data/record/trackdata/trackid/@unformatted"/>
                  <xsl:with-param name="showbitrate" select="'False'"/>
                  <xsl:with-param name="showfoldericon" select="'True'"/>
                  <xsl:with-param name="showaddtoplaylisticon" select="'True'"/>
                  <xsl:with-param name="standardicon" select="'True'"/>
                </xsl:call-template>
                <xsl:call-template name="format-videosample">
                  <xsl:with-param name="videosample" select="data/record/trackdata/videosample"/>
                  <xsl:with-param name="trackid" select="data/record/trackdata/trackid/@unformatted"/>
                </xsl:call-template>
                <a href="TrackList_Songwriter.xsl?Title={data/record/trackdata/title}@validate=yes,2,2@orderby=Artist,Title@xslparam:doctitle=

{/data/fld/track/title/@name}: {data/record/trackdata/title}" target="_blank">
                  <img border="0" src="GoToPage.gif" style="margin-left:3px;"/>
                </a>
                <xsl:if test="data/record/trackdata/@playlist='True'">
                  <a href="PlaylistTrackList.xsl?TrackID={data/record/trackdata/trackid/@unformatted}@xslparam:doctitle={$playlist_doctitle}" 

target="_blank"><img border="0" src="Playlist.gif" style="margin-left:3px;"/></a>
                </xsl:if>
                <xsl:if test="count(data/record/trackdata/subtitles/subtitle)>0">
                  <br/>
                  <xsl:for-each select="data/record/trackdata/subtitles/subtitle">
                    <xsl:value-of select="."/> 
                    <xsl:if test="position() &lt; last() "> 
                      <xsl:text> / </xsl:text>
                    </xsl:if> 
                  </xsl:for-each>
                </xsl:if>      
              </td>
            </tr>
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/artist/@name"/></td> 
              <td class="record_pane_table_fieldvalue">
                <xsl:call-template name="format-artist">
                  <xsl:with-param name="artists" select="data/record/trackdata/artists"/>
                  <xsl:with-param name="newwindow" select="'True'"/>
                </xsl:call-template>	
              </td>
            </tr>                        
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/length/@name"/></td>
              <td class="record_pane_table_fieldvalue"><xsl:value-of select="data/record/trackdata/length"/></td>
            </tr>
            <xsl:if test="count(data/record/trackdata/authorcredits/authorcredit)">
            <tr>
              <td class="record_pane_table_fieldname" nowrap="">Songwriter</td>
              <td class="record_pane_table_fieldvalue"><xsl:apply-templates select="data/record/trackdata/authorcredits"/></td>
            </tr>
            </xsl:if>                     
            <xsl:if test="data/record/trackdata/originalby!=''">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/originalby/@name"/></td>
	      <td class="record_pane_table_fieldvalue">
                <a href="ArtistPerson.xsl?ID={data/record/trackdata/originalby/@id}" target="_blank"><xsl:value-of 

select="data/record/trackdata/originalby/text()"/></a>
              </td>
            </tr>    
            </xsl:if>
            <xsl:if test="data/record/trackdata/released!=''">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/released/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <a href="TrackList.xsl?Released={data/record/trackdata/released/@year}@xslparam:doctitle={/data/fld/track/released/@name}: 

{data/record/trackdata/released/@year}" target="_blank">
                  <xsl:value-of select="data/record/trackdata/released"/>
                </a>
              </td>
            </tr>    
            </xsl:if>
            <tr> 
              <td class="record_pane_table_group" colspan="2">Recording / Library</td>
            </tr>
            <tr>
              <td class="record_pane_table_group_padding" colspan="2"></td>
            </tr>
            <xsl:if test="data/record/trackdata/bpm/@unformatted > 0">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/bpm/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <a href="TrackList.xsl?BPM={data/record/trackdata/bpm}@xslparam:doctitle={/data/fld/track/bpm/@name}: 

{data/record/trackdata/bpm}" target="_blank">
                  <xsl:value-of select="data/record/trackdata/bpm"/>
                </a>
              </td>
            </tr>    
            </xsl:if>
            <xsl:if test="data/record/trackdata/tour!=''">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/tour/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <a href="TrackList.xsl?Tour={data/record/trackdata/tour}@xslparam:doctitle={/data/fld/track/tour/@name}: 

{data/record/trackdata/tour}" target="_blank">
                  <xsl:value-of select="data/record/trackdata/tour"/>
                </a>
              </td>
            </tr>    
            </xsl:if>                                
            <xsl:if test="data/record/trackdata/venue!=''">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/venue/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <a href="TrackList.xsl?Venue={data/record/trackdata/venue}@xslparam:doctitle={/data/fld/track/venue/@name}: 

{data/record/trackdata/venue}" target="_blank">
                  <xsl:value-of select="data/record/trackdata/venue"/>
                </a>
              </td>
            </tr>    
            </xsl:if>                                                                           
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/personalrating/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <xsl:if test="data/record/trackdata/personalrating/@image!=''">        
                  <a href="TrackList.xsl?PersonalRating={data/record/trackdata/personalrating}@xslparam:doctitle=

{/data/fld/track/personalrating/@name}: {data/record/trackdata/personalrating}" target="_blank">
                    <img src="{data/record/trackdata/personalrating/@image}" border="0"/>                
                  </a>
                </xsl:if>
                <a href="CMD:SETRATING:Track,PersonalRating,{data/record/trackdata/trackid/@unformatted}">          
                  <img src="SetRating.gif" border="0" style="margin-left: 3px;"/>
                </a>      
              </td>
            </tr>                     
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/genre/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <xsl:call-template name="format-genre">
                  <xsl:with-param name="genrelist" select="data/record/trackdata/genrelist"/>
                  <xsl:with-param name="templatefile" select="'TrackList.xsl'"/>
                  <xsl:with-param name="newwindow" select="'True'"/>
                  <xsl:with-param name="setgenre_table" select="'Track'"/>
                  <xsl:with-param name="setgenre_recordid" select="data/record/trackdata/trackid/@unformatted"/>
                </xsl:call-template>            
              </td>
            </tr> 
            <xsl:if test="count(data/record/trackdata/keywords/keyword) > 0">
            <tr> 
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/keyword/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <xsl:call-template name="format-keywords">
                  <xsl:with-param name="keywords" select="data/record/trackdata/keywords"/>
                  <xsl:with-param name="templatefile" select="'TrackList.xsl'"/> 
                  <xsl:with-param name="newwindow" select="'True'"/>
                  <xsl:with-param name="newline" select="'False'"/>
                </xsl:call-template>
              </td>
            </tr>
            </xsl:if>                      
            <xsl:if test="data/record/trackdata/lastplayed!=''">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/lastplayed/@name"/></td>
              <td class="record_pane_table_fieldvalue">        
                <a href="TrackList.xsl?PlayHistory={data/record/trackdata/lastplayed/@unformatted}@xslparam:doctitle=

{/data/fld/track/lastplayed/@name}: {data/record/trackdata/lastplayed}" target="_blank">
                  <xsl:value-of select="data/record/trackdata/lastplayed"/><xsl:text> </xsl:text><xsl:value-of 

select="data/record/trackdata/lastplayed/@shorttime"/>                
                </a>                      
              </td>
            </tr>
            </xsl:if>
            <xsl:if test="data/record/trackdata/playcount>0">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/playcount/@name"/></td>
              <td class="record_pane_table_fieldvalue">        
                <a href="PlayHistory.xsl?TrackID={data/record/trackdata/trackid/@unformatted}@xslparam:doctitle=Play History: {$doctitle}

@xslparam:param_trackid={data/record/trackdata/trackid/@unformatted}" target="_blank">
                  <xsl:value-of select="data/record/trackdata/playcount"/>                
                </a>  
              </td>
            </tr>
            </xsl:if>
            <xsl:if test="count(data/record/trackdata/chartinfolist/chartinfo) > 0">
            <tr> 
              <td class="record_pane_table_group" colspan="2">Chart Info</td>
            </tr>
            <tr>
              <td class="record_pane_table_group_padding" colspan="2"></td>
            </tr>
            <tr>
              <td class="record_pane_table_fieldvalue" colspan="2">
                <xsl:call-template name="format-chartinfo">
                  <xsl:with-param name="chartinfolist" select="data/record/trackdata/chartinfolist"/>
                  <xsl:with-param name="newwindow" select="'True'"/>
                </xsl:call-template>
              </td>
            </tr> 
            </xsl:if>                                                   
          </table>
        </td>
        <td valign="top" width="*">
          <table class="record_pane_table" cellspacing="1" cellpadding="0">
            <tr> 
              <td class="record_pane_table_group" colspan="2"><xsl:value-of select="/data/fld/track/lyrics/@name"/> </td>
            </tr>
            <tr>
              <td class="record_pane_table_group_padding" colspan="2"></td>
            </tr>
            <tr>
              <td class="record_pane_table_fieldvalue" colspan="2">                     
                <xsl:if test="data/record/trackdata/lyrics!=''"> 
                <xsl:call-template name="add-line-breaks"> 
                  <xsl:with-param name="string" select="data/record/trackdata/lyrics"/> 
                </xsl:call-template> 
                <br/> 
                </xsl:if> 
                <a href="CMD:EDITMEMO:Track,Lyrics,{data/record/trackdata/trackid/@unformatted}"><img src="EditMemo.gif" border="0"/></a> 
              </td> 
            </tr>
            <tr> 
              <td class="record_pane_table_group" colspan="2"><xsl:value-of select="/data/fld/track/notes/@name"/> </td>
            </tr>
            <tr>
              <td class="record_pane_table_group_padding" colspan="2"></td>
            </tr>
            <tr>
              <td class="record_pane_table_fieldvalue" colspan="2">                     
                <xsl:if test="data/record/trackdata/notes!=''"> 
                <xsl:call-template name="add-line-breaks"> 
                  <xsl:with-param name="string" select="data/record/trackdata/notes"/> 
                </xsl:call-template> 
                <br/> 
                </xsl:if> 
                <a href="CMD:EDITMEMO:Track,Notes,{data/record/trackdata/trackid/@unformatted}"><img src="EditMemo.gif" border="0"/></a> 
              </td> 
            </tr> 
            <xsl:if test="count(data/record/trackdata/filelinks/filelink) > 0">
            <tr> 
              <td class="record_pane_table_group" colspan="2"><xsl:value-of select="/data/fld/track/filelinks/@name"/></td>
            </tr>
            <tr>
              <td class="record_pane_table_group_padding" colspan="2"></td>
            </tr>          
            <tr>           
              <td class="record_pane_table_fieldvalue" colspan="2">
                <xsl:call-template name="format-filelinks">
                  <xsl:with-param name="filelinks" select="data/record/trackdata/filelinks"/> 
                </xsl:call-template>
              </td>
            </tr>
            </xsl:if>                     
            <xsl:if test="count(data/record/trackdata/weblinks/weblink) > 0">
            <tr> 
              <td class="record_pane_table_group" colspan="2"><xsl:value-of select="/data/fld/track/weblinks/@name"/></td>
            </tr>
            <tr>
              <td class="record_pane_table_group_padding" colspan="2"></td>
            </tr>                  
            <tr> 
              <td class="record_pane_table_fieldvalue" colspan="2">
                <xsl:call-template name="format-weblinks">
                  <xsl:with-param name="weblinks" select="data/record/trackdata/weblinks"/> 
                </xsl:call-template>
              </td>
            </tr>
            </xsl:if>
            <tr> 
              <td class="record_pane_table_group" colspan="2">Album Data</td>
            </tr>
            <tr>
              <td class="record_pane_table_group_padding" colspan="2"></td>
            </tr>                  
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/album/title/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <a href="Album.xsl?id={data/record/albumdata/albumid/@unformatted}" target="_blank"><xsl:value-of 

select="data/record/albumdata/title"/></a>
                <xsl:if test="data/record/albumdata/@audioattached='True'">
                  <a href="PLAYALL:{data/record/albumdata/albumid/@unformatted}"><img src="PlayAlbum.gif" border="0" style="margin-

left=3px;"/></a>
                </xsl:if>     	                
              </td>
            </tr>
            <xsl:if test="/data/record/trackdata/artists/@sort != /data/record/albumdata/artists/@sort">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/album/artist/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <xsl:call-template name="format-artist">
                  <xsl:with-param name="artists" select="data/record/albumdata/artists"/>
                  <xsl:with-param name="newwindow" select="'True'"/>
                </xsl:call-template>
              </td>
            </tr>
            </xsl:if>
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/album/format/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <a href="AlbumList.xsl?Format={data/record/albumdata/format}@xslparam:doctitle={/data/fld/album/format/@name}: 

{data/record/albumdata/format}" target="_blank">
                  <xsl:value-of select="data/record/albumdata/format"/>
                </a>
              </td>
            </tr>
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/album/released/@name"/></td>
              <td class="record_pane_table_fieldvalue">
                <a href="AlbumList.xsl?Released={data/record/albumdata/released/@year}@xslparam:doctitle={/data/fld/album/released/@name}: 

{data/record/albumdata/released/@year}" target="_blank">
                  <xsl:value-of select="data/record/albumdata/released"/>
                </a>
              </td>
            </tr>
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/album/referenceno/@name"/></td>
              <td class="record_pane_table_fieldvalue"><xsl:value-of select="data/record/albumdata/referenceno"/></td>
            </tr>                           
          </table>
        </td>
      </tr>
    </table>
  </body>  
  </html>
</xsl:template>

<xsl:template match="authorcredits">
  <xsl:for-each select="authorcredit">
    <a href="ArtistPerson.xsl?ID={@id}" target="_blank"><xsl:value-of select="name"/></a>
    <xsl:if test="count(roles/role) > 0">
    <xsl:text> (</xsl:text>
    <xsl:for-each select="roles/role">
      <xsl:value-of select="."/>
      <xsl:if test="position() &lt; last()">
        <xsl:text> / </xsl:text>
      </xsl:if>    
    </xsl:for-each>
    <xsl:text>)</xsl:text>
    </xsl:if>    
    <xsl:if test="position() &lt; last()">
      <xsl:text> / </xsl:text>
    </xsl:if>    
  </xsl:for-each>
</xsl:template>

</xsl:stylesheet>  
King regards
Peer

User avatar
DougWilliams
Site Admin
Posts: 364
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Custom XSL

Post by DougWilliams » Tue Jun 09, 2020 12:56 am

Hello Peer
I'm not sure what file you pulled the code from but all you should need to add, right after

Code: Select all

<a href="ArtistPerson.xsl?ID={data/record/trackdata/originalby/@id}" target="_blank">
				<xsl:value-of select="data/record/trackdata/originalby/text()"/></a>
Insert

Code: Select all

<xsl:if test="custom30!=''">
	<xsl:text> (</xsl:text><xsl:value-of select="custom30"/><xsl:text>)</xsl:text>
</xsl:if>
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

Peerli
Posts: 30
Joined: Sun Sep 06, 2015 3:54 pm

Re: Custom XSL

Post by Peerli » Tue Jun 09, 2020 4:07 pm

Hi Doug.
Thanx for your help.
The code doesn't matter. In the reports I have in the control name: "Field_Original year" and in the name: "Original year". I only used the "Custom30" date field.

Code: Select all

</xsl:if>                     
            <xsl:if test="data/record/trackdata/originalby!=''">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/originalby/@name"/></td>
	      <td class="record_pane_table_fieldvalue">
                <a href="ArtistPerson.xsl?ID={data/record/trackdata/originalby/@id}" target="_blank"><xsl:value-of 

select="data/record/trackdata/originalby/text()"/></a>
	    <xsl:if test="Field_Original-Jahr!=''">
	<xsl:text> (</xsl:text><xsl:value-of select="Field_Original-Jahr"/><xsl:text>)</xsl:text>
	</xsl:if>
              </td>
            </tr>    
            </xsl:if>
            <xsl:if test="data/record/trackdata/released!=''">
Regards
Peer

User avatar
DougWilliams
Site Admin
Posts: 364
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Custom XSL

Post by DougWilliams » Tue Jun 09, 2020 9:36 pm

I was under the impression that XSL required the original field name (Custom30).
Any change in the field name via the interface was handled by the @name for XSL.
<xsl:value-of select="/data/fld/track/originalby/@name"/>
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

Peerli
Posts: 30
Joined: Sun Sep 06, 2015 3:54 pm

Re: Custom XSL

Post by Peerli » Wed Jun 10, 2020 4:36 pm

Hi Doug.
I do not understand what you mean. "originalby" is still displayed correctly, but "Field_Original-Jahr" is not.
amii_2.jpg
amii_2.jpg (87.71 KiB) Viewed 146 times
amii_3.jpg
amii_3.jpg (32.01 KiB) Viewed 146 times
properties.jpg
properties.jpg (58.88 KiB) Viewed 146 times

Code: Select all

<xsl:if test="data/record/trackdata/originalby!=''">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/originalby/@name"/></td>
	      <td class="record_pane_table_fieldvalue">
                <a href="ArtistPerson.xsl?ID={data/record/trackdata/originalby/@id}" target="_blank"><xsl:value-of select="data/record/trackdata/originalby/text()"/></a>
	    <xsl:if test="Original-Jahr!=''">
	<xsl:text> (</xsl:text><xsl:value-of select="Field_Original-Jahr"/><xsl:text>)</xsl:text>
	</xsl:if>
              </td>
            </tr>    
            </xsl:if>
Peer

User avatar
DougWilliams
Site Admin
Posts: 364
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Custom XSL

Post by DougWilliams » Wed Jun 10, 2020 5:14 pm

You still have to call it "Custom30" in XSL is how I understand things.
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

Peerli
Posts: 30
Joined: Sun Sep 06, 2015 3:54 pm

Re: Custom XSL

Post by Peerli » Thu Jun 11, 2020 6:46 am

Code: Select all

            <xsl:if test="data/record/trackdata/originalby!=''">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/track/originalby/@name"/></td>
	      	  <td class="record_pane_table_fieldvalue">
                <a href="ArtistPerson.xsl?ID={data/record/trackdata/originalby/@id}" target="_blank"><xsl:value-of select="data/record/trackdata/originalby/text()"/></a>
	    		<xsl:if test="data/record/trackdata/custom30!=''">
					<xsl:text> (</xsl:text><xsl:value-of select="data/record/trackdata/custom30/text()"/><xsl:text>)</xsl:text>
				</xsl:if>
              </td>
            </tr>    
            </xsl:if>

Peerli
Posts: 30
Joined: Sun Sep 06, 2015 3:54 pm

Re: Custom XSL

Post by Peerli » Thu Jun 11, 2020 10:28 am

With Color:

Code: Select all

            <xsl:if test="data/record/trackdata/originalby!=''">
            <tr>
              <td class="record_pane_table_fieldname" nowrap=""><xsl:text>Original von</xsl:text></td>
	      	  <td style="color: green;" class="record_pane_table_fieldvalue">
                <a href="ArtistPerson.xsl?ID={data/record/trackdata/originalby/@id}" target="_blank"><xsl:value-of 

select="data/record/trackdata/originalby/text()"/></a>
	    		<xsl:if test="data/record/trackdata/custom30!=''">
					<xsl:text> (</xsl:text><xsl:value-of select="data/record/trackdata/custom30/text()"/><xsl:text>)

</xsl:text>
				</xsl:if>
              </td>
            </tr>    
            </xsl:if>

User avatar
DougWilliams
Site Admin
Posts: 364
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Custom XSL

Post by DougWilliams » Thu Jun 11, 2020 11:09 am

I don't know what template you edited.

I edited Track.xsl with my above suggestion. Is this what you want? ( Note in the Custom section Custom 30 is "Original Year")
Annotation 2020-06-11 060634.jpg
Annotation 2020-06-11 060634.jpg (94.07 KiB) Viewed 134 times
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

User avatar
DougWilliams
Site Admin
Posts: 364
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Custom XSL

Post by DougWilliams » Thu Jun 11, 2020 11:18 am

I just realized something.

What you showed were the form changes you made. To properly rename a field you should right click on the field in the form and select Change Name or go to TOOLS > Database Setup.

Explorer Templates use these for the @Name value.
Annotation 2020-06-11 061900.jpg
Annotation 2020-06-11 061900.jpg (25.04 KiB) Viewed 133 times
Annotation 2020-06-11 061430.jpg
Annotation 2020-06-11 061430.jpg (134.8 KiB) Viewed 133 times
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

Post Reply