Yes it is RSS so the database's RSS should be enabled and you can copy the single view template to the RSS template so that your desired format will already be stored in the RSS and all that will remain is to display it. And then ... you open for editing a label resource, html block, section description or any other editable html section and in text mode add an identified div element and two script elements. This solution assumes that the load and display functions reside in a js file and referred to from the main page--that's the first script element. The second script element is for calling these functions and writing the content into the div element. Here is how it may look:
<div id="DataWarmUp"></div>
<script type="text/javascript" src="http://--------------/moodle/file.php/---/scripts/xmlutils.js"></script>
<script type="text/javascript">
var currentWarmUp=loadXML('http://----------------/moodle/rss/file.php/-------/---/data/--/rss.xml'); document.getElementById('DataWarmUp').innerHTML=displayDesc(currentWarmUp); </script>
In this example the xmlutils.js is stored in the course files in a folder called 'scripts' but you can store it anywhere you want as long as you get the right url and enter it to the code.
Here are the javascript functions:
function loadXML(file) {
if (document.implementation && document.implementation.createDocument) {
xmlDoc = document.implementation.createDocument("", "", null);
} else {
if (window.ActiveXObject) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
} else {
alert('Your browser can\'t handle this script');
return;
}
}
xmlDoc.async=false;
xmlDoc.load(file);
return xmlDoc;
}
function displayDesc (xmlDoc) {
var items = xmlDoc.getElementsByTagName('item');
if (items.length>0) {
var itemContent="";
for (j=0;j<items[0].childNodes.length;j++) {
if (items[0].childNodes[j].nodeType!=1) continue;
var itemName=items[0].childNodes[j].nodeName;
if (itemName=='description') {
itemContent=items[0].childNodes[j].firstChild.nodeValue;
}
}
}
return itemContent;
}
The display function here is simplified so as to be clearer. Thus it will always take the first item in the RSS file which is supposed to be the last added entry. But that also means that you can't add the next warm-up too early because it will immediately show up on the main page. Of course the code may be more flexible and select the item for display according to week or some other method. This can be added later on if you decide to use this approach and you find you need a different display method.
So, this is it. If you need more details just let me know.