CAL: A school event list widget

Jan 23, 2018

You can configure a short event list for display on your school’s home page.  The idea is appealing to many schools, however with so many different page themes to contend with we needed to implement this with the flexibility to handle anything the school’s web designer would throw at us.

For this reason we publish the data in a plain XML format and then offer an XSLT document to style the data into the form and look required by the school.

The XML data

The simplest way to present this is with an example containing just one event.  Normally you would have a number of events repeated in this data:

<sobs-calendar-events>
<event-list>
<event>
<category>Special events</category>
<description>Swimming carnival</description>
<timestart>25-10-2011 8:40am</timestart>
<timeend>25-10-2011 2:45pm</timeend>
<contactphone>0455 555 333</contactphone>
<contactemail> coach@acme.edu.au</contactemail>
<contactname>Coach Tim</contactname>
</event>
</event-list>
</sobs-calendar-events>

Enable this function and locate the URL

  1. Login to the SOBS School Calendar application as a SOBS administrator
  2. Click on your school name (bottom left) and then on “App configuration”
  3. Click on “School Calendar” in the top left menu
  4. You are now viewing the application settings for the School Calendar.
  5. Ensure the “Public view” is enabled and the XSLT URL will be displayed on this page.
  6. When the XSLT URL appears you will also see a sample XSL Template which you can modify as necessary to make your events match your website design.

You can now copy that URL and place it in a frame on your school’s home page.  If you are not sure what a frame is you may need to get some help from a web designer or http://www.w3schools.com

If you are modifying the XSL Template, we recommend have a couple of different browser windows open, one to edit the template, and the other to check the view (using the URL provided).

Event list URL options

The “schoolid” option is required and must reflect the default URL displayed.

You can also add a “limit” option to limit the number of events displayed.  For example: https://sobs.com.au/cal3/events2xml.php?schoolid=9&limit=6   – this would limit the number of events displayed to six.

Formatting the event list for your School

We apply a default XSLT document to the XML data described above to create the default layout.  You can view this layout by entering the Event list URL into your browser – a list of current “public” events will be displayed using the default template.

NOTE: You will need some knowledge of coding HTML in order to complete this process

You can now modify this template as required.