Last active
March 10, 2017 23:32
-
-
Save jessgusclark/891b7ce9c05c1505a4aed5f58fed56ae to your computer and use it in GitHub Desktop.
Get All Files with the Tag of the page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:template name="GetDataFilesWithTag"> | |
<!-- Get the current file's path --> | |
<xsl:variable name="current-page" | |
select="concat('ou:/Tag/GetTags?', 'site=', $ou:site, '&path=', replace($ou:path, '.html', '.pcf')" /> | |
<!-- Get the first Tag that is associated with this subject listing page --> | |
<xsl:variable name="page-tag" select="doc( $current-page ) )/tags/tag[1]/name" /> | |
<!-- Get Data Files With the Tag --> | |
<xsl:variable name="tag-select" | |
select="doc( concat('ou:/Tag/GetFilesWithAnyTags?site=', $ou:site, '&tag=', $page-tag) )" /> | |
<!-- Loop through the pages that contain the keyword: --> | |
<xsl:for-each select="$tag-select/pages/page"> | |
<!-- Sort the pages by the path --> | |
<xsl:sort select="path" /> | |
<!-- Pass the path to a new function to handle the next step --> | |
<xsl:call-template name="GetContentFromSingleDataFile"> | |
<xsl:with-param name="data-url" select="path" /> | |
</xsl:call-template> | |
</xsl:for-each> | |
</xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment