【问题标题】:DSpace logo community - DSpace 6.2 XMLUIDSpace 标志社区 - DSpace 6.2 XMLUI
【发布时间】:2018-05-08 06:05:55
【问题描述】:

我正在尝试编辑 communitylist.xsl 以修改主页模板以添加社区徽标,但还没有成功。

我正在使用 XMLUI - Mirage2

这里是主页模板示例图片

输入:https://www.repository.cam.ac.uk/

我应该添加或修改什么?

谢谢。

【问题讨论】:

    标签: xslt dspace


    【解决方案1】:

    我们的存储库在整个层次结构中应用了 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多