Skip to content

Commit

Permalink
Merge pull request #571 from openSUSE/suseheader-fix
Browse files Browse the repository at this point in the history
Fix SUSE header to avoid issues with new+old header code
  • Loading branch information
tomschr authored Aug 28, 2023
2 parents ff360ed + 5bb9048 commit 1fb0820
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 1fb0820

Please sign in to comment.