Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" version="1.0" exclude-result-prefixes="xsl ddwrt msxsl x d" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:rssFeed="urn:schemas-microsoft-com:sharepoint:RSSAggregatorWebPart" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rss1="http://purl.org/rss/1.0/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atom2="http://purl.org/atom/ns#">
- <xsl:param name="rss_FeedLimit">8</xsl:param>
- <xsl:param name="rss_ExpandFeed">false</xsl:param>
- <xsl:param name="rss_LCID">1033</xsl:param>
- <xsl:param name="rss_WebPartID">RSS_Viewer_WebPart</xsl:param>
- <xsl:param name="rss_alignValue">left</xsl:param>
- <xsl:param name="rss_IsDesignMode">True</xsl:param>
- <xsl:output method="html" indent="no" />
- <xsl:template match="rss">
- <xsl:call-template name="RSSMainTemplate" /></xsl:template>
- <xsl:template name="RSSMainTemplate" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
- <xsl:variable name="Rows" select="channel/item" />
- <xsl:variable name="RowCount" select="count($Rows)" />
- <div class="slm-layout-main">
- <xsl:call-template name="RSSMainTemplate.body">
- <xsl:with-param name="Rows" select="$Rows" />
- <xsl:with-param name="RowCount" select="count($Rows)" /></xsl:call-template>
- </div>
- </xsl:template>
- <xsl:template name="RSSMainTemplate.body" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
- <xsl:param name="Rows" />
- <xsl:param name="RowCount" />
- <xsl:for-each select="$Rows">
- <xsl:variable name="CurPosition" select="position()" />
- <xsl:variable name="RssFeedLink" select="$rss_WebPartID" />
- <xsl:variable name="CurrentElement" select="concat($RssFeedLink,$CurPosition)" />
- <xsl:call-template name="RSSDescTransform1">
- <xsl:with-param name="DescriptionField" select="description" /></xsl:call-template>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="RSSDescTransform1" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
- <xsl:param name="DescriptionField" />
- <xsl:variable name="itemTitle" select="title" />
- <xsl:variable name="itemAuthor" select="substring-before(substring-after($DescriptionField, 'itemAuthor:</b> '),'</div>')" />
- <xsl:variable name="itemPubDate" select="substring-before(substring-after($DescriptionField, 'itemPubDate:</b> '),'</div>')" />
- <xsl:variable name="itemDescription" select="substring-before(substring-after($DescriptionField, 'itemDescription:</b> '),'</div>')" />
- <xsl:variable name="itemHTML" select="substring-after($DescriptionField, 'itemHTML:</b> ')" />
- <xsl:variable name="itemLink" select="substring-before(substring-after($DescriptionField, 'href="'),'"')" />
- <xsl:call-template name="RSSDescTransform2">
- <xsl:with-param name="itemTitle" select="$itemTitle" />
- <xsl:with-param name="itemAuthor" select="$itemAuthor" />
- <xsl:with-param name="itemPubDate" select="$itemPubDate" />
- <xsl:with-param name="itemDescription" select="$itemDescription" />
- <xsl:with-param name="itemLink" select="$itemLink" />
- <xsl:with-param name="itemHTML" select="$itemHTML" /></xsl:call-template>
- </xsl:template>
- <xsl:template name="RSSDescTransform2" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
- <xsl:param name="itemTitle" />
- <xsl:param name="itemAuthor" />
- <xsl:param name="itemPubDate" />
- <xsl:param name="itemDescription" />
- <xsl:param name="itemLink" />
- <xsl:param name="itemHTML" />
- <xsl:choose>
- <xsl:when test="$itemAuthor='Twitter'">
- <div class="social-post-twitter industry-item">
- <!--<a href="{$itemLink}" target="_blank">-->
- <xsl:value-of select="$itemHTML" disable-output-escaping="yes" />
- <!--</a>-->
- </div>
- <div class="industry-text" style="padding-left:36px">
- <xsl:value-of select="ddwrt:FormatDateTime(string($itemPubDate), number($rss_LCID), 'MMMM dd, yyyy')" />
- </div>
- </xsl:when>
- <xsl:when test="$itemAuthor='Facebook'">
- <div class="social-post-facebook industry-item"> <a href="{$itemLink}" target="_blank">
- <xsl:value-of select="$itemTitle"/>
- </a>
- </div>
- <div class="industry-text" style="padding-left:36px">
- <xsl:value-of select="ddwrt:FormatDateTime(string($itemPubDate), number($rss_LCID), 'MMMM dd, yyyy')" />
- </div>
- </xsl:when>
- <xsl:when test="$itemAuthor='Youtube'">
- <div class="social-post-youtube industry-item"> <a href="{$itemLink}" target="_blank">
- <xsl:value-of select="$itemTitle"/>
- </a>
- </div>
- <div class="industry-text" style="padding-left:36px">
- <xsl:value-of select="ddwrt:FormatDateTime(string($itemPubDate), number($rss_LCID), 'MMMM dd, yyyy')" />
- </div>
- </xsl:when>
- <xsl:when test="$itemAuthor='Flickr'">
- <div class="social-post-flickr industry-item"> <a href="{$itemLink}" target="_blank">
- <xsl:value-of select="$itemTitle"/>
- </a>
- </div>
- <div class="industry-text" style="padding-left:36px">
- <xsl:value-of select="ddwrt:FormatDateTime(string($itemPubDate), number($rss_LCID), 'MMMM dd, yyyy')" />
- </div>
- </xsl:when>
- <xsl:when test="$itemAuthor='OSQAR'">
- <div class="social-post-osqar industry-item"> <a href="{$itemLink}" target="_blank">
- <xsl:value-of select="$itemTitle"/>
- </a>
- </div>
- <div class="industry-text" style="padding-left:36px">
- <xsl:value-of select="ddwrt:FormatDateTime(string($itemPubDate), number($rss_LCID), 'MMMM dd, yyyy')" />
- </div>
- </xsl:when>
- <xsl:when test="$itemAuthor='PumpTalk'">
- <div class="social-post-pumptalk industry-item"> <a href="{$itemLink}" target="_blank">
- <xsl:value-of select="$itemTitle"/>
- </a>
- </div>
- <div class="industry-text" style="padding-left:36px">
- <xsl:value-of select="ddwrt:FormatDateTime(string($itemPubDate), number($rss_LCID), 'MMMM dd, yyyy')" />
- </div>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment