Hello unclecheese,
I am trying to extend your event_calendar so that I get a rollover popup when I hover the cell <td class="hasEvent">.
Now I have got the jQuery and CSS worked out so this can popup I just neeed to be able to add another field to the CalendarEvent.php so that I can enter some brief text for the rollover to show, and I need to be able to update what the $LiveCalendarWidget outputs so that it shows:
<td class=" hasEvent"> <a href="/silverstripe/silverstripe-v2.4.1/calendar/view/20100820">20<span>This is what will show in the rollover popup</span></a></td>
instead of:
<td class=" hasEvent"> <a href="/silverstripe/silverstripe-v2.4.1/calendar/view/20100820">20</a></td>
So that the text in the span is shown on the rollover.
Are you able to please show me what files I need to modifiy to do this?
For the adding field part I have only ever done this:
class ResultsPage extends Page {
static $db = array(
'Calendarhovertext' => 'Text'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('Calendarhovertext'), 'Content');
return $fields;
}
etc
I had a look at CalendarEvent.php
I see
static $db = array (
'Recursion' => 'Boolean',
'CustomRecursionType' => 'Int',
'DailyInterval' => 'Int',
'WeeklyInterval' => 'Int',
'MonthlyInterval' => 'Int',
'MonthlyRecursionType1' => 'Int',
'MonthlyRecursionType2' => 'Int',
'MonthlyIndex' => 'Int',
'MonthlyDayOfWeek' => 'Int'
'Rollovertext' => 'Text'
);
I presume I add 'Calendarhovertext' => 'Text' to here.
The public function getCMSFields()
{
$f = parent::getCMSFields();
function looks a bit different than normal, what do I do there???
If you could please show me how to modify that <td> output and what to do with this field would be great.