This tutorial applies to Calendar v2. Before following steps in this tutorial make sure you have downloaded the latest version of Calendar template.
We'll show how to display an icon next to each event on Monthly view.
Here is how this can be done.
- Add a new field to calcalendar table. In our example that will be img field that stores icon URL.
- Modify SQL query of all views where this field needs to appear adding this new field to the list.
SELECT
id,
DateField,
...
Category,
OwnerID,
img
FROM calcalendar
3. On 'Choose fields' screen choose page where new field needs to appear i.e. Add/Edit/View pages of certain views.
4. Now proceed to <project folder>\Business\Calendar\source\include folder and open calendar_functions.php file in any text editor.
You will need to modify function function calendar_getEventHTML adding text in bold.
$strtmp = $event[calendarGetSetting("calendarSubject")];
if (strlen(trim($strtmp))==0 )
$strtmp="<Empty>";
if (strlen($strtmp)>$_SESSION["calendar_SubjectLength"])
$strtmp = substr($strtmp,0,$_SESSION["calendar_SubjectLength"])."...";
if ($event["img"])
$strtmp .= " <img height=16 width=16 src='".$event["url"]."'>";