[Solved] show Credits + Pseudonym

Discuss using and your tips/tricks for BookCAT
User avatar
Alex Ivanovich
Posts: 268
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

[Solved] show Credits + Pseudonym

Postby Alex Ivanovich » Fri Apr 14, 2017 10:19 pm

I would like to show in "BookBrowse.xsl" Credits, this :roll:

Credits + Pseudonym

look photo
Attachments
Credits+Pseudonym.png
Credits+Pseudonym.png (235.57 KiB) Viewed 212 times
Last edited by Alex Ivanovich on Sun Apr 16, 2017 3:17 pm, edited 1 time in total.

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

Re: show Credits + Pseudonym

Postby LotsOCds » Sat Apr 15, 2017 2:00 pm

This is needed in BookBrowse.xsl. (Alex, you already have this in your template.)

Code: Select all

<?data lookuptable="person"?>

Add this wherever you want the pseudonym to the "format-credits" template in Common.xsl.

Code: Select all

            <xsl:if test="count(lookupdata/pseudonyms/pseudonym)>0">
              <xsl:text> (</xsl:text>
              <xsl:for-each select="lookupdata/pseudonyms/pseudonym">
                <xsl:value-of select="name"/>
                <xsl:if test="position() &lt; last()">
                  <xsl:text>, </xsl:text>
                </xsl:if>
              </xsl:for-each>
              <xsl:text>)</xsl:text>
            </xsl:if>
Cheers,
Dave

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

Re: show Credits + Pseudonym

Postby Alex Ivanovich » Sun Apr 16, 2017 2:45 pm

thanks Dave :) , it works fine ;)

small question:
why you entered "count" in the code? :roll:

Happy Easter :D

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

Re: show Credits + Pseudonym

Postby LotsOCds » Sun Apr 16, 2017 2:56 pm

Alex Ivanovich wrote:small question:
why you entered "count" in the code?

The count checks to see if there are any pseudonyms. Without this test the parentheses "()" would always print.
Cheers,
Dave

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

Re: show Credits + Pseudonym

Postby Alex Ivanovich » Sun Apr 16, 2017 3:03 pm

LotsOCds wrote:
Alex Ivanovich wrote:small question:
why you entered "count" in the code?

The count checks to see if there are any pseudonyms. Without this test the parentheses "()" would always print.


interesting, :)
I would not have solved itself,
although now, with your teachings,i understand the "XSLT code" better than many years ago

thank you :) ;)


Return to “Using BookCAT”

Who is online

Users browsing this forum: No registered users and 1 guest