Drop Shadow

Complex links

If you require more complex links than just a key-based URL, you can create them using a link callback function. Tell the plug-in about it using “$calendar->linkcallback”. Like the standard link maker, you can specify the key field, or let it assume that the field is “ID”.

You will probably need to tell the plug-in that you need extra fields selected as well. Use “$calendar->selectextra” for that. Note that you receive the key automatically in the field 'key'.

Your function will receive the current record as an array. Your function will need to return the actual URL to use as the link for that record.

$myCalendar->selectextra('category'); $myCalendar->linkcallback('myLinkMaker', 'slug'); function myLinkMaker($record) { $category = $record['category']; $key = $record['key']; if ($category == '12') { $link = 'http://www.sandiego.edu/news/news/?_focus=' . $key; } elseif ($category == '10') { $link = 'http://www.sandiego.edu/news/eventcalendar/?_focus=' . $key; } else { $link = false; } return $link; }