我已经尝试编辑communitylist.xsl修改主页模板,以添加社区标志,但还没有运气。
我使用的是XMLUI - Mirage2
在这里,主页模板示例映像
in:https://www.repository.cam.ac.uk/
我应该添加或修改什么?
谢谢。
发布于 2018-05-07 22:05:55
我们的存储库在层次结构中应用了40个不同的标识。我是如何做到这一点的。
基于社区/集合句柄设置标头变量
<xsl:key name="myancestor" match="/dri:document/dri:meta/dri:pageMeta/dri:trail/@target|/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='URI']/text()" use="substring-after(.,'handle/')"/>
<xsl:variable name="IS_ZZZ" select="key('myancestor','12345/6789')"/>
<xsl:choose>
<xsl:when test="$IS_ZZZ">
<xsl:call-template name="showLogo">
<xsl:with-param name="header-logo" select="concat($theme-path,'/images/zzz.png')"/>
<xsl:with-param name="header-logo-alt">ZZZ</xsl:with-param>
<xsl:with-param name="header-logo-link">http://zzz.edu</xsl:with-param>
<xsl:with-param name="header-logo-link-lang">ZZZ Website</xsl:with-param>
</xsl:call-template>
</xsl:when>在处理标头元素时,插入徽标标记
<xsl:template match="dri:div[@n='community-home' or @n='collection-home']/dri:head" priority="3">
<xsl:call-template name="showLogo">
<xsl:with-param name="header-logo" select="$header-logo"/>
<xsl:with-param name="header-logo-link" select="$header-logo-link"/>
<xsl:with-param name="header-logo-link-lang" select="$header-logo-link-lang"/>
<xsl:with-param name="header-logo-alt" select="$header-logo-alt"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="showLogo">
<xsl:param name="header-logo"/>
<xsl:param name="header-logo-link"/>
<xsl:param name="header-logo-link-lang"/>
<xsl:param name="header-logo-alt"/>
<xsl:call-template name="renderHead">
<xsl:with-param name="class">ds-div-head</xsl:with-param>
</xsl:call-template>
<div class="gu-theme-logo-div">
<a>
<xsl:if test="$header-logo-link">
<xsl:attribute name="href">
<xsl:value-of select="$header-logo-link"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="$header-logo-link-lang"/>
</xsl:attribute>
</xsl:if>
<img class="gu-theme-logo hidden-sm hidden-xs">
<xsl:attribute name="src">
<xsl:value-of select="$header-logo"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="$header-logo-alt"/>
</xsl:attribute>
</img>
<span class="hidden-md hidden-lg">
<xsl:value-of select="$header-logo-link-lang"/>
</span>
</a>
</div>
</xsl:template>https://stackoverflow.com/questions/50222739
复制相似问题