html-export-question

Discuss using and your tips/tricks for CATraxx
Cally
Posts: 39
Joined: Wed Sep 16, 2015 6:25 am
Location: Germany

html-export-question

Post by Cally » Tue Oct 25, 2016 4:22 pm

Hi everybody,

once again I'm coming up with a programming-question.

Is it possible to place sub-titles under the tracktitle in a html-page?

Like this:
A-1: Apollo Medley 12:49
. 1.) Get Ready
. 2.) Ain't Too Proud To Beg
. 3.) The Way You Do the Things You Do
. 4.) My Girl
A-2: When Something Is Wrong with My Baby 4:44
A-3: Everytime You Go Away 7:07
and so on.....

I don't know how to place sub-titles (this can be from two up to 5 or 10 or 15)

Thanks for any hints

Greets from germany
Martin

Azol
Posts: 82
Joined: Wed Sep 09, 2015 11:44 am

Re: html-export-question

Post by Azol » Tue Oct 25, 2016 8:47 pm

I am in no way a programmer. All I was able to find is this portion of code that displays subtitles info in album details pane:

Code: Select all

<xsl:if test="count(subtitles/subtitle)>0">
   <br/>
   <xsl:for-each select="subtitles/subtitle">
       <xsl:value-of select="."/>
       <xsl:if test="position() < last() "> 
          <xsl:text> / </xsl:text>
       </xsl:if> 
   </xsl:for-each>
</xsl:if>

Cally
Posts: 39
Joined: Wed Sep 16, 2015 6:25 am
Location: Germany

Re: html-export-question

Post by Cally » Wed Oct 26, 2016 5:31 pm

Thanks, this code I found too ;)
But how to implement into the html-export? :?:

Azol
Posts: 82
Joined: Wed Sep 09, 2015 11:44 am

Re: html-export-question

Post by Azol » Wed Oct 26, 2016 9:00 pm

I can see there is an option to edit XSL code for a Track field. But you should be able to write an XSL template for displaying tracks with subtitles.
screen1.png
screen1.png (107.86 KiB) Viewed 980 times
Look at this thread for possible hints - viewtopic.php?f=12&t=48#p95

Azol
Posts: 82
Joined: Wed Sep 09, 2015 11:44 am

Re: html-export-question

Post by Azol » Wed Oct 26, 2016 9:47 pm

((deleted my xsl code since LotsOCds just offered the correct solution.))
Last edited by Azol on Fri Oct 28, 2016 9:13 am, edited 1 time in total.

User avatar
LotsOCds
Posts: 177
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: html-export-question

Post by LotsOCds » Fri Oct 28, 2016 4:47 am

I am far far away from my CATraxx computer right now so I can't test it, but I think this code will do what you need. Insert it as XSL code in the Album.Tracks field as shown in Azol's screen shot.

Code: Select all

<xsl:for-each select="/data/record/trackdata/disc/side/track">
    <xsl:if test="/data/record/trackdata/@sides = 2">
        <xsl:value-of select="../sideno"/>
    </xsl:if>
    <xsl:value-of select="index"/>.
    <xsl:value-of select="fulltitle"/>
    <xsl:if test="artists/@sort != /data/record/albumdata/artists/@sort">
        <xsl:text> / </xsl:text>
        <xsl:call-template name="format-artist">
            <xsl:with-param name="artists" select="artists"/>
        </xsl:call-template>
    </xsl:if>
    <xsl:text> (</xsl:text><xsl:value-of select="length"/>)
    <xsl:if test="count(authorcredits/authorcredit) > 0">
        <br/>
        <xsl:text>(</xsl:text>
        <xsl:call-template name="format-authorcredits">
            <xsl:with-param name="authorcredits" select="authorcredits/authorcredit"/>
            <xsl:with-param name="showsortby" select="'false'"/>
            <xsl:with-param name="incrole" select="'false'"/>
            <xsl:with-param name="newline" select="'false'"/>
            <xsl:with-param name="separator1" select="'/'"/>
            <xsl:with-param name="separator2" select="'/'"/>
        </xsl:call-template>
        <xsl:text>)</xsl:text>
    </xsl:if>
    <xsl:if test="count(subtitles/subtitle)>0">
        <br/>
        <xsl:for-each select="subtitles/subtitle">
            &#160;&#160;
            <xsl:value-of select="position()"/>)
            <xsl:value-of select="."/>
            <xsl:if test="position() < last() ">
                <br/>
            </xsl:if>
        </xsl:for-each>
    </xsl:if>
    <xsl:if test="position() < last() ">
        <br/>
    </xsl:if>
</xsl:for-each>
Let me know how it goes.
Cheers,
Dave

Cally
Posts: 39
Joined: Wed Sep 16, 2015 6:25 am
Location: Germany

Re: html-export-question

Post by Cally » Fri Oct 28, 2016 7:11 am

Many thanks for all the tips so far.
I hope to find time this weekend for checking out

Azol
Posts: 82
Joined: Wed Sep 09, 2015 11:44 am

Re: html-export-question

Post by Azol » Fri Oct 28, 2016 9:11 am

LotsOCds, your solution works for me, so I hope it will for OP as well. Thanks a lot for your help!

Cally
Posts: 39
Joined: Wed Sep 16, 2015 6:25 am
Location: Germany

Re: html-export-question

Post by Cally » Mon Oct 31, 2016 5:04 pm

Thanks a lot.
It works :!:

User avatar
LotsOCds
Posts: 177
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: html-export-question

Post by LotsOCds » Tue Nov 01, 2016 1:33 am

Good to know. Glad to help!
Cheers,
Dave

Post Reply