Skip to content

Instantly share code, notes, and snippets.

@bemosior
Last active December 28, 2015 08:49
Show Gist options
  • Save bemosior/7474856 to your computer and use it in GitHub Desktop.
Save bemosior/7474856 to your computer and use it in GitHub Desktop.
Jasig CAS + Ektron CMS integration for Shippensburg University of Pennsylvania
<!-- Jasig CAS + Ektron CMS integration for Shippensburg University of Pennsylvania -->
<!-- Assumes the use of jQuery and Twitter Bootstrap 3 -->
<div class="col-md-12" id="ajax-announcements">
<!-- Announcements -->
</div>
<div class="panel-body" id="ajax-information">
<!-- Introduction / Information with a spinner image placeholder -->
<img class="img-responsive" src="/CAS/images/spinner.gif">
</div>
<!-- CMS Content Items (last element of the <body/>)-->
<script type="text/javascript" language="JavaScript">
<jsp:directive.include file="cms-includes.js" />
</script>
/* Jasig CAS + Ektron CMS integration for Shippensburg University of Pennsylvania */
/* Assumes the use of jQuery and Twitter Bootstrap 3 */
/* Displays announcements section if <Html/> XML element contains data */
$.get("/CMS/getContentWithMetaData?contentId=00000",
function(xml) {
var html = $(xml).find('Html').text();
if(html.length > 0) {
$("#ajax-announcements").html('<div id="announcements" class="alert alert-danger">'+html+'</div>');
}
},
"xml"
);
/* Displays information section (always) */
$.get("/CMS/getContent?contentId=00000",
function(xml) {
$("#ajax-information").html($(xml).find('Html').text());
},
"xml"
);
<ContentData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ship.edu/">
<Title>Announcements</Title>
<Html>
<h3><b>Tuesday, September 10, 2013&nbsp; 2:00 PM</b></h3> <p>This is an example announcement.</p>
</Html>
</ContentData>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment