PDA

View Full Version : multiple calendars for categories


phthornton
02-07-2010, 08:08 PM
I have installed epc into my wordpress site, very easy install and all works great.

However, what i want to be able to do is display a mini calendar on a number of different pages and for the calendar to only show events relevant to that page.

I am currently displaying the calendar in my sidebar using the following:

if (is_page('88') ) {
require("calendar/calendar.php");
} elseif ( is_page('91') ) {
require("calendar/calendar.php");
............

For example:

Area 1 page will show events that are categorised as area 1
Area 2 page will show events that are categorised as area 2 and so on.

on the main / index page I am displaying a list of events using:

<?php
$LIST=1;
$DF = "D - M d";
$template="monthly.php";
$listWeeks = "52";
$listEvents = "8";
$epcListMouseover = "1";
require ("calendar/calendar.php");
?>

As I have said these all work well but I do need to be able to pull specific groups of events into any particular calendar.

Having a single administration calendar isn't a problem.

Thanks in advance.

ve9gra
02-07-2010, 09:43 PM
Setup categories (or sub-categories) that will define which pages the events will show up on. Then find the values of the categories using the Advanced Filter in the Event Manager. Once you've found the values for each category, use $showCat to limit the output of the calendar to the category selected.

In your case, you'd use a different $showCat for each if(is_page('XX').

phthornton
02-08-2010, 12:07 PM
nice one, works a treat.

next step is - can a calendar show multiple categories, but not all of them?

I have tried $showCat="14, 12"; without success.

I guess an array would be required?

Peter

Brian
02-08-2010, 02:51 PM
$showCat="X";
Filter the list of events by category "X".
Use the Advanced Filter option of the Event Manager to construct specific filters. While viewing the Advanced Filter screen after executing a filter (click Find / Filter then Advanced in the Event Manager), at the end of the yellow Filter table is a code. Add this code to the $showCat variable to perform this filter operation in your own pages. It will appear like "1|4|7 or a|2|5|9".
Add this just before require("calendar/calendar.php");

phthornton
02-08-2010, 04:53 PM
:bigsmiley