Skip to content

Instantly share code, notes, and snippets.

@ctbarber
Created March 27, 2017 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctbarber/b85c497a24f42b145937f7dcf26f6f96 to your computer and use it in GitHub Desktop.
Save ctbarber/b85c497a24f42b145937f7dcf26f6f96 to your computer and use it in GitHub Desktop.
<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">
&lt;?php
foreach ($uthsc_news as $key => $posts) {
echo 'newsAjax("https://news.uthsc.edu/wp-json/wp/v2/posts?categories=' . $posts['categories'] . '&amp;per_page=' . $posts['post_count'] . '&amp;_embed", ' . '\'' . $key . '\',' . $posts['post_count'] .');' . "\r\n";
} ?&gt;
</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