Created
March 27, 2017 19:29
-
-
Save ctbarber/b85c497a24f42b145937f7dcf26f6f96 to your computer and use it in GitHub Desktop.
This file contains 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="check_for_news_boxes"> | |
<xsl:if test="/document/main-content/rows/row/*/div/*/table/@class = 'snippet-news-boxes'"> | |
<xsl:choose> | |
<xsl:when test="$ou:action = 'pub'"> | |
<script src="/-resources/2015/js/uthsc-news-ajax.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
<xsl:text disable-output-escaping="yes"> | |
<?php | |
foreach ($uthsc_news as $key => $posts) { | |
echo 'newsAjax("https://news.uthsc.edu/wp-json/wp/v2/posts?categories=' . $posts['categories'] . '&per_page=' . $posts['post_count'] . '&_embed", ' . '\'' . $key . '\',' . $posts['post_count'] .');' . "\r\n"; | |
} ?> | |
</xsl:text> | |
}); | |
</script> | |
</xsl:when> | |
<xsl:otherwise></xsl:otherwise> | |
</xsl:choose> | |
</xsl:if> | |
</xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment