Event system question(s)

A place to ask questions and get help. Be the first on your block to post ...

Event system question(s)

Postby lsazama3 » Wed Apr 14, 2010 12:32 pm

1. I was wondering if it is possible to have 2 calendars (List of Upcoming Events) included on the same page. We would like to have the main Math calendar as well as our Colloquia calendar included on our home page, but I wasn't sure if this was possible. We don't want the two calendars combined because the colloquia calendar has several events and we would only like to show 2-3 at a time.

2. Also, if the above is possible, is it possible to change the text that says "Upcoming Events" when displaying the List of Upcoming Events? I could then change the text so we could tell the difference between the two calendars.

Any help or suggestions is appreciated.


Posts: 2
Joined: Tue May 12, 2009 10:46 am

Postby bbieber2 » Thu Apr 15, 2010 1:54 pm

Hey Larissa,

Two event lists on one page should be no problem.

First some basics. If you have two calendars you have two upcoming event lists which you can pull from:
http://events.unl.edu/math-colloquia/up ... ar&limit=3
(notice the limit parameter, which controls how many you want)

The second question is how to retrieve them. You can either retrieve them on the server with PHP, or use Javascript on the client-side, either way will work but you'll need to decide which way to go.

If you're doing this on the server side with PHP, I'd use something like
Code: Select all
<?php echo file_get_contents('http://events.unl.edu/math/upcoming/?format=hcalendar'); ?>

On the client side, we can probably start with the events plugin provided with the templates, but we may need to do some tweaking, by setting the calendar URL and limit parameters before initializing it:

But basically we'll be retrieving the content, either hiding the default title "Upcoming Events" or replacing it, and use CSS to style the results.

The CSS included in the templates is pretty nice, but if you'd like to go a different route I understand completely.

This page has a lot more info that might be useful:
http://www1.unl.edu/wdn/wiki/Extracting ... e_Calendar

Hopefully that gives you some ideas.
Posts: 58
Joined: Mon Nov 05, 2007 1:28 pm

Postby bbieber2 » Fri Apr 16, 2010 8:58 am

I've made a couple modifications to the events js so that multiple event listings can be displayed on one page, here's an example of that.

Basically you have two containers with unique IDs, math_upcoming_events, and math_colloquia_events, each with the class of wdn_calendarDisplay so they get the events CSS.

Then in the script, set the vars for each calendar before you call initialize().

It's always helpful to provide default text for the search engines and users that have no javascript, OR, if retrieving the events fails.

Code: Select all
            <div id="math_upcoming_events" class="two_col left wdn_calendarDisplay">
                <a href="http://events.unl.edu/math/">Math Events</a>
            <div id="math_colloquia_events" class="col right wdn_calendarDisplay">
                <a href="http://events.unl.edu/math-colloquia/">Math Colloquia Events</a>
            <script type="text/javascript">
            WDN.initializePlugin('events', function() {
                WDN.events.calURL    = 'http://events.unl.edu/math/';
                WDN.events.calTitle  = 'Math';
                WDN.events.container = '#math_upcoming_events';

                WDN.events.calURL    = 'http://events.unl.edu/math-colloquia/';
                WDN.events.calTitle  = 'Math Colloquia';
                WDN.events.limit     = 3;
                WDN.events.container = '#math_colloquia_events';
Posts: 58
Joined: Mon Nov 05, 2007 1:28 pm

Another question regarding an additional calendar

Postby lsazama3 » Wed May 12, 2010 3:23 pm

Thank you, Brett, for all of your help.

I have an additional question. Right now, I have the two calendars (Math and Math Colloquia). Is it possible to change the text "Upcoming Events" for the Math Colloquia calendar so it has a different heading than the main Math calendar? This way it is easier for the users to distinquish between the two calendars.

Thanks for any help you can give.

Posts: 2
Joined: Tue May 12, 2009 10:46 am

Return to Help & Assistance

Who is online

Users browsing this forum: No registered users and 0 guests