Skip to content

Instantly share code, notes, and snippets.

@peterdietz
Created March 11, 2011 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterdietz/866640 to your computer and use it in GitHub Desktop.
Save peterdietz/866640 to your computer and use it in GitHub Desktop.
adding rss links to dspace
<!-- Peter: Add RSS Links to Page -->
<!-- bds: xsl:if test prevents box from appearing when there aren't any RSS feeds for a page -->
<xsl:if test="count(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='feed']) != 0">
<h3 id="ds-feed-option-head" class="ds-option-set-head"><xsl:text>RSS Feeds</xsl:text></h3>
<div id="ds-feed-option" class="ds-option-set">
<!-- bds: see OSU-local.xsl for addRSSLinks -->
<ul><xsl:call-template name="addRSSLinks"/></ul>
</div>
</xsl:if>
<!-- Peter's RSS code for options box -->
<xsl:template name="addRSSLinks">
<xsl:for-each select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='feed']">
<li><a>
<xsl:attribute name="href">
<xsl:value-of select="."/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="contains(., 'rss_1.0')"><img src="/dspace/static/icons/feed.png" alt="Icon for RSS 1.0 feed" />RSS 1.0</xsl:when>
<xsl:when test="contains(., 'rss_2.0')"><img src="/dspace/static/icons/feed.png" alt="Icon for RSS 2.0 feed" />RSS 2.0</xsl:when>
<xsl:when test="contains(., 'atom_1.0')"><img src="/dspace/static/icons/feed.png" alt="Icon for Atom feed" />Atom</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@qualifier"/>
</xsl:otherwise>
</xsl:choose>
</a></li>
</xsl:for-each>
</xsl:template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment