Skip to content

Instantly share code, notes, and snippets.

@spdustin
Created August 8, 2013 00:10
Show Gist options
  • Save spdustin/6180211 to your computer and use it in GitHub Desktop.
Save spdustin/6180211 to your computer and use it in GitHub Desktop.
Untested Global News Thingy
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- This XSL Stylesheet created by SharePoint Experts, Inc. -->
<!-- http://sharepointexperience.com -->
<xsl:param name="ServerRelativeUrl"/>
<xsl:param name="RootSiteUrl"/>
<xsl:output method="html" indent="yes"/>
<!-- This template is the "wrapper" or "container" for the custom view. -->
<xsl:template match="/">
<!-- This is the actual wrapper element that will be emitted -->
<h1>Global Templates FTW!</h1>
<div id="accordion">
<!-- This will tell the data view to look for the actual content
and come back when it's done. -->
<xsl:choose>
<xsl:when test="$ServerRelativeUrl = $RootSiteUrl">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="/dsQueryResponse/Rows/Row[@WebUrl=$ServerRelativeUrl]"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
</div>
<script>
$('#accordion').accordion();
</script>
<!-- end wrapper -->
</xsl:template>
<xsl:template match="/dsQueryResponse/Rows/Row">
<!-- This markup is used for each item in the list -->
<h3><xsl:value-of select="@Title"/></h3>
<div><xsl:value-of select="@Body" disable-output-escaping="yes"/></div>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment