DeveloperTutorials for Web Developers & DesignersOther

Calendars

The posts functionality of Oncord can be used in combination with the <ss:data:calendar> interface control to produce an events calendar. This allows admin users to easily maintain a calendar on their website through the posts page of the admin panel.

Example

Pictured below is a post-based calendar implemented on a website. The post image, title, linked page and date are used to display an event on the calendar. Clicking on an event will redirect the user to the page linked to the post (if the post has a linked page).

Getting started

Before coding the calendar a new post category should be setup, which will be used to sort all the posts which will be display as events.

  1. Login to the dashboard, click on the "Posts" link in the left hand sidebar.
  2. Click the "Categories" button to view all the post categories currently setup on the website.
  3. Click "New Category", it's a good idea to name the category calendar, or events.

FAQ - Should the calendar post category be a primary category? Or an additional category?
If an event post will be created with the sole purpose of displaying it in the events calendar it should be created as a primary category. Otherwise is should be created as an additional category.

Source code

Simply copy the code below into the page source, replacing the post category id in getAllForCategory(3) with the correct post category id number.

Using the calendar

To add a new event to the calendar simply create a post and asign it to the post category associated with the calendar. The post date is used to position the post in the calendar, you can alter a post date by clicking on the "Additional attributes" tab while editing / creating a post.