Skip to main content Link Menu Expand (external link) Left Arrow Right Arrow Document Search Copy Copied

How to Use

Adding Events to a Page

There are two formats that the events widget is arranged in:

Carousel Slider

To add the events carousel slider to an SCDS WordPress page, use a shortcode block and include the following line:

[iframe src="https://learn.scds.ca/event-listings/events-carousel" width="100%" scrolling="no" height="400px" ]

To add the events carousel to any other page, use the following iframe code:

<iframe src="https://learn.scds.ca/event-listings/events-carousel" width="100%" scrolling"yes" height="400px">
</iframe>

Events Grid

To add the events grid to an SCDS WordPress page, use a shortcode block and include the following line:
[iframe src="https://learn.scds.ca/event-listings/style-2-grid" width="100%" height="1200px" scroll="yes"]

To add the events carousel to any other page, use the following iframe code:

<iframe src="https://learn.scds.ca/event-listings/style-2-grid" width="100%" scrolling"yes" height="1200px">
</iframe>

Adding/updating Events Manually

To add or update the events that are listed, you have to modify _data/events.json.

When an event is over or a new event is added, update the information in _data/events.json. This can be done manually or through automation.

In _data/events.json, an event will have the following data. To remove the event manually, erase the event’s information along with its opening and closing brackets {} and any comma that follows.

The event’s information includes:

Adding/updating Events Automatically (Must be Done Locally)

Clone this repository onto your computer. Go to your computer’s terminal and locate where you want this repository to be cloned.

Install node.js to your computer. Download link is at nodejs.org/en/download

Open your computer terminal and locate the event-listings repository. For example, if event-listings was cloned in your Documents folder, type the following into terminal:

cd Documents/event-listings/

Update events by typing the following into the terminal:

node assets/js/fetch-events.js

This will populate _data/events.json with updated events information.

Then type the following in terminal:

git commit --all

The terminal will change to something like the following.

Type ‘a’ which will allow you to add a commit message. In this case, it would be updated events.

Once done, press the esc button, type :wq and press enter, which will allow you to escape the message window.

Finally, enter the following in terminal:

git push

Press enter.

The updated events will now populate onto the event widgets. You’re done!

Relevant Backend Search Code

If edits to the code are required, see the below.

Made by Tram Nguyen.