[TFS Changeset #65165]

This commit is contained in:
boxbinary
2010-03-31 23:31:30 +00:00
parent 14e566b93d
commit 1e4fb9d3f6
4 changed files with 91 additions and 91 deletions

View File

@@ -1,92 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rssdatehelper="urn:rssdatehelper"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rssdatehelper="urn:rssdatehelper"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" {0}
exclude-result-prefixes="msxml umbraco.library {1}">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<!-- Update these variables to modify the feed -->
<xsl:variable name="RSSNoItems" select="string('10')"/>
<xsl:variable name="RSSTitle" select="string('My sample rss')"/>
<xsl:variable name="SiteURL" select="string('Add your url here')"/>
<xsl:variable name="RSSDescription" select="string('Add your description here')"/>
<!-- This gets all news and events and orders by updateDate to use for the pubDate in RSS feed -->
<xsl:variable name="pubDate">
<xsl:for-each select="$currentPage/node">
<xsl:sort select="@createDate" data-type="text" order="descending" />
<xsl:if test="position() = 1">
<xsl:value-of select="updateDate" />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:template match="/">
<!-- change the mimetype for the current page to xml -->
<xsl:value-of select="umbraco.library:ChangeContentType('text/xml')"/>
<xsl:text disable-output-escaping="yes">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</xsl:text>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel>
<title>
<xsl:value-of select="$RSSTitle"/>
</title>
<link>
<xsl:value-of select="$SiteURL"/>
</link>
<pubDate>
<xsl:value-of select="$pubDate"/>
</pubDate>
<generator>umbraco</generator>
<description>
<xsl:value-of select="$RSSDescription"/>
</description>
<language>en</language>
<xsl:apply-templates select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
<xsl:sort select="@createDate" order="descending" />
</xsl:apply-templates>
</channel>
</rss>
</xsl:template>
<xsl:template match="node">
<xsl:if test="position() &lt;= $RSSNoItems">
<item>
<title>
<xsl:value-of select="@nodeName"/>
</title>
<link>
<xsl:value-of select="$SiteURL"/>
<xsl:value-of select="umbraco.library:NiceUrl(@id)"/>
</link>
<pubDate>
<xsl:value-of select="umbraco.library:FormatDateTime(@createDate,'r')" />
</pubDate>
<guid>
<xsl:value-of select="$SiteURL"/>
<xsl:value-of select="umbraco.library:NiceUrl(@id)"/>
</guid>
<content:encoded>
<xsl:value-of select="concat('&lt;![CDATA[ ', ./data [@alias='bodyText'],']]&gt;')" disable-output-escaping="yes"/>
</content:encoded>
</item>
</xsl:if>
</xsl:template>
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<!-- Update these variables to modify the feed -->
<xsl:variable name="RSSNoItems" select="string('10')"/>
<xsl:variable name="RSSTitle" select="string('My sample rss')"/>
<xsl:variable name="SiteURL" select="string('Add your url here')"/>
<xsl:variable name="RSSDescription" select="string('Add your description here')"/>
<!-- This gets all news and events and orders by updateDate to use for the pubDate in RSS feed -->
<xsl:variable name="pubDate">
<xsl:for-each select="$currentPage/node">
<xsl:sort select="@createDate" data-type="text" order="descending" />
<xsl:if test="position() = 1">
<xsl:value-of select="updateDate" />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:template match="/">
<!-- change the mimetype for the current page to xml -->
<xsl:value-of select="umbraco.library:ChangeContentType('text/xml')"/>
<xsl:text disable-output-escaping="yes">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</xsl:text>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel>
<title>
<xsl:value-of select="$RSSTitle"/>
</title>
<link>
<xsl:value-of select="$SiteURL"/>
</link>
<pubDate>
<xsl:value-of select="$pubDate"/>
</pubDate>
<generator>umbraco</generator>
<description>
<xsl:value-of select="$RSSDescription"/>
</description>
<language>en</language>
<xsl:apply-templates select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
<xsl:sort select="@createDate" order="descending" />
</xsl:apply-templates>
</channel>
</rss>
</xsl:template>
<xsl:template match="node">
<xsl:if test="position() &lt;= $RSSNoItems">
<item>
<title>
<xsl:value-of select="@nodeName"/>
</title>
<link>
<xsl:value-of select="$SiteURL"/>
<xsl:value-of select="umbraco.library:NiceUrl(@id)"/>
</link>
<pubDate>
<xsl:value-of select="umbraco.library:FormatDateTime(@createDate,'r')" />
</pubDate>
<guid>
<xsl:value-of select="$SiteURL"/>
<xsl:value-of select="umbraco.library:NiceUrl(@id)"/>
</guid>
<content:encoded>
<xsl:value-of select="concat('&lt;![CDATA[ ', ./data [@alias='bodyText'],']]&gt;')" disable-output-escaping="yes"/>
</content:encoded>
</item>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -83,7 +83,7 @@
<xsl:value-of select="umbraco.library:NiceUrl(@id)"/>
</guid>
<content:encoded>
<xsl:value-of select="concat('&lt;![CDATA[ ', .bodyText,']]&gt;')" disable-output-escaping="yes"/>
<xsl:value-of select="concat('&lt;![CDATA[ ', ./bodyText,']]&gt;')" disable-output-escaping="yes"/>
</content:encoded>
</item>
</xsl:if>

View File

@@ -19,7 +19,7 @@
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/* [name() = $propertyAlias]/links/link">
<xsl:for-each select="$currentPage/* [name() = $propertyAlias and not(@isDoc)]/links/link">
<li>
<xsl:element name="a">
<xsl:if test="./@newwindow = '1'">

View File

@@ -7,7 +7,7 @@
<xsl:attribute name="value">Data Source=.\SQLEXPRESS;Initial Catalog=BB_Umbraco_Sandbox1;integrated security=false;user id=umbraco;pwd=umbraco</xsl:attribute>
</xsl:template>
<xsl:template match="/configuration/appSettings/add[@key='umbracoConfigurationStatus']/@value">
<xsl:attribute name="value">4.1.0.beta</xsl:attribute>
<xsl:attribute name="value"></xsl:attribute>
</xsl:template>
<!-- Default templates to match anything else -->