Skip to content

Instantly share code, notes, and snippets.

@jessgusclark
Created April 14, 2016 16:35
Show Gist options
  • Save jessgusclark/ba6cb2ed4511a9d71ab61e614f0b4e58 to your computer and use it in GitHub Desktop.
Save jessgusclark/ba6cb2ed4511a9d71ab61e614f0b4e58 to your computer and use it in GitHub Desktop.
<!-- Template that takes a URL and formats the content: -->
<xsl:template name="GetContentFromSingleDataFile">
<xsl:param name="data-url" />
<!-- Get the full path to the data file: -->
<xsl:variable name="full-path" select="concat($ou:root, $ou:site, $data-url)" />
<!-- Get Data File Content -->
<xsl:variable name="page-content" select="doc($full-path)/document" />
<!-- Check to see if it is a data file since the subject page also has this tag associated with it -->
<xsl:if test="$page-content/page/@type = 'library-database'">
<!-- Check to see if the data file is set to 'active' -->
<xsl:if test="$page-content/ouc:properties[@label='config']/parameter[@name='active']/option[@selected='true'] = 'True'">
<!-- Display the Journal's Information: -->
<h2><xsl:value-of select="$page-content/ouc:properties[@label='config']/parameter[@name='database-name']" /></h2>
<p><xsl:value-of select="$page-content/ouc:properties[@label='config']/parameter[@name='database-description']" /></p>
<a href="{$page-content/ouc:properties[@label='config']/parameter[@name='database-url']}">Open Database</a>
<hr/>
</xsl:if>
</xsl:if>
</xsl:template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment