Skip to content

Commit

Permalink
Fix SUSE header to avoid new+old header code
Browse files Browse the repository at this point in the history
Thanks to Gayathri, we included a xsl:choose to distinguish
between old and new header code.

Co-authored-by: Gayathri Gandaboyina <[email protected]>
  • Loading branch information
tomschr and GGayathri3 committed Aug 28, 2023
1 parent ff360ed commit 5bb9048
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 30 deletions.
34 changes: 19 additions & 15 deletions suse2022-ns/xhtml/chunk-common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -257,23 +257,27 @@
<body>
<xsl:call-template name="body.attributes" />
<xsl:call-template name="outerelement.class.attribute" />
<xsl:if test="$include.suse.header">
<xsl:variable name="candidate.suse.header.body">
<xsl:call-template name="string.subst">
<xsl:with-param name="string" select="$include.ssi.body" />
<xsl:with-param name="target" select="$placeholder.ssi.language" />
<xsl:with-param name="replacement" select="$lang-attr" />
<xsl:choose>
<xsl:when test="number($include.suse.header) = 1">
<xsl:variable name="candidate.suse.header.body">
<xsl:call-template name="string.subst">
<xsl:with-param name="string" select="$include.ssi.body" />
<xsl:with-param name="target" select="$placeholder.ssi.language" />
<xsl:with-param name="replacement" select="$lang-attr" />
</xsl:call-template>
</xsl:variable>
<xsl:text>&#10;</xsl:text>
<xsl:comment>#include virtual="<xsl:value-of select="$candidate.suse.header.body" />"</xsl:comment>
<xsl:text>&#10;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="bypass">
<xsl:with-param name="format" select="'chunk'" />
</xsl:call-template>
</xsl:variable>
<xsl:text>&#10;</xsl:text>
<xsl:comment>#include virtual="<xsl:value-of select="$candidate.suse.header.body" />"</xsl:comment>
<xsl:text>&#10;</xsl:text>
</xsl:if>
<xsl:call-template name="bypass">
<xsl:with-param name="format" select="'chunk'" />
</xsl:call-template>

<xsl:call-template name="user.header.content" />
<xsl:call-template name="user.header.content" />
</xsl:otherwise>
</xsl:choose>

<xsl:call-template name="breadcrumbs.navigation" />

Expand Down
31 changes: 16 additions & 15 deletions suse2022-ns/xhtml/docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -755,14 +755,17 @@
<xsl:call-template name="body.attributes"/>
<xsl:call-template name="outerelement.class.attribute"/>

<xsl:if test="$include.suse.header">
<xsl:text>&#10;</xsl:text>
<xsl:comment>#include virtual="<xsl:value-of select="$candidate.suse.header.body"/>"</xsl:comment>
<xsl:text>&#10;</xsl:text>
</xsl:if>
<xsl:call-template name="bypass"/>

<xsl:call-template name="user.header.content"/>
<xsl:choose>
<xsl:when test="number($include.suse.header) = 1">
<xsl:text>&#10;</xsl:text>
<xsl:comment>#include virtual="<xsl:value-of select="$candidate.suse.header.body"/>"</xsl:comment>
<xsl:text>&#10;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="bypass" />
<xsl:call-template name="user.header.content" />
</xsl:otherwise>
</xsl:choose>

<xsl:call-template name="breadcrumbs.navigation"/>

Expand Down Expand Up @@ -915,13 +918,11 @@ if (window.location.protocol.toLowerCase() != 'file:') {
</xsl:call-template>
</xsl:variable>

<xsl:if test="$include.suse.header = 0">
<header id="_mainnav">
<div class="growth-inhibitor">
<xsl:call-template name="create.header.logo"/>
</div>
</header>
</xsl:if>
<header id="_mainnav">
<div class="growth-inhibitor">
<xsl:call-template name="create.header.logo" />
</div>
</header>
</xsl:template>

<xsl:template name="user.footer.content">
Expand Down

0 comments on commit 5bb9048

Please sign in to comment.