Skip to content

Commit

Permalink
Fix series selection for SBP FO stylesheets
Browse files Browse the repository at this point in the history
Use the same algorithm as in HTML.

Ref: DOCTEAM-1368
Ref: PR #625
  • Loading branch information
tomschr committed May 14, 2024
1 parent 875dcf6 commit 3a06603
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions sbp/fo/article.titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@
</fo:table-cell>
<fo:table-cell text-align="right" color="&c_jungle;">
<fo:block font-size="&xxx-large;pt">
<xsl:value-of select="$json-ld-seriesname"/>
<xsl:choose>
<xsl:when test="$json-ld-seriesname != ''">
<xsl:value-of select="$json-ld-seriesname"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="d:info/d:meta[@name='series'][1]" mode="article.titlepage.recto.auto.mode"/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
<fo:block font-size="&large;pt" space-before="1em">
<xsl:apply-templates select="d:info/d:meta[@name='category'][1]" mode="article.titlepage.recto.auto.mode"/>
Expand Down Expand Up @@ -107,7 +114,8 @@
</xsl:template>

<xsl:template match="d:meta[@name='series']" mode="article.titlepage.recto.auto.mode">
<!-- We don't process it anymore, using $json-ld-seriesname parameter -->
<!-- Only process it when $json-ld-seriesname != '' -->
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="d:meta[@name='category']" mode="article.titlepage.recto.auto.mode">
Expand Down
2 changes: 1 addition & 1 deletion sbp/xhtml/titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
</xsl:choose>

<div class="series-category">
<xsl:comment/>
<xsl:comment/><!-- Add empty comment in case we don't create series nor categories -->
<xsl:call-template name="add.series.name"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:info/d:meta[@name='category' or @name='type']"/>
</div>
Expand Down

0 comments on commit 3a06603

Please sign in to comment.