Table of Contents
- Creating a calendar of future events in EE.
- Getting started
- Setting up the big calendar
- Entering events
- List upcoming events
- Other Resources
Creating a calendar of future events in EE.
Getting started
Create a new weblog. We’ll call it “calendar.” (Shocking, isn’t it.)
Setting up the big calendar
Create a new template or modify the index template of your calendar weblog to include the big calendar code as described in the calendar tag documentation. Include the show_future_entries=“yes” parameter:
{exp:weblog:calendar switch="calendarToday|calendarCell" weblog="calendar" show_future_entries="yes"}
To link event titles to a page with more detail, create another template. We’ll call it “details.” Its contents should look more or less like any other page that would display weblog entries. In the big calendar template, your entry list should look something like this:
{entries}
<p><a href="{title_permalink=calendar/details}">{title}</a></p> {/entries}
Entering events
Create a new post in the calendar weblog. Use the entry date to enter the date of your event.
For events that span several days, use the entry’s expiration date to enter the end date of your event. This will make the event scroll off the list once it’s over.
List upcoming events
You can list upcoming events on other pages. Here’s a sidebar example:
<h2 class="sidetitle">Upcoming Events</h2>
<ul> {exp:weblog:entries weblog="calendar" show_future_entries="yes" orderby="date" sort="desc" dynamic="on" limit="5"}
<li><a href="{title_permalink=calendar/details}">{title}</a> ({entry_date format='%M %j'})</li>
{/exp:weblog:entries}
</ul>
When listing multi-day and single-day events, you can use PHP in your templates to conditionally display the end date as described in this forum thread.
Other Resources
Train-ee.com has a series of free tutorials covering the implementation of an event calendar.
Category:Events Category:Calendar
