Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Event Calendar - displaying extra variables?


Go to End


3 Posts   840 Views

Avatar
borriej

Community Member, 267 Posts

19 February 2011 at 1:46am

Edited: 19/02/2011 1:52am

Hello All,

I've extended the event calendar module with two fields:

class CalendarEvent extends Page
{
	static $db = array (
		'Recursion' => 'Boolean',
		'CustomRecursionType' => 'Int',
		'DailyInterval' => 'Int',
		'WeeklyInterval' => 'Int',
		'MonthlyInterval' => 'Int',
		'MonthlyRecursionType1' => 'Int',
		'MonthlyRecursionType2' => 'Int',
		'MonthlyIndex' => 'Int',
		'MonthlyDayOfWeek' => 'Int',
		'Uitslag' => 'Text',
		'SoortWedstrijd' => 'Text'
		);
....

So 'Uitslag' => 'Text',
'SoortWedstrijd' => 'Text'

are new fields.

Now i want to display the upcomming events on my homepage:


class Homepage_Controller extends Page_Controller {

	public function Events() {
		$today = date("Y-m-d");
		return DataObject::get_one("Calendar")->Events(null, $today, null, false, 5, null);
	}

in the template i use:

									<% control Events %>
									   
										   <li>
											  <h4>$EventTitle</h4>
											  <span>$_Dates</span>
											  <span>$SoortWedstrijd</span>
											  <span>$Content</span>
										   </li>
									   
									<% end_control %>

But $Content & $SoortWedstrijd aren't showing up on my homepage. EventTitle & Dates do show up.

How do i fix this?

Thx!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

19 February 2011 at 4:09am

$Event.CustomField

Avatar
borriej

Community Member, 267 Posts

20 February 2011 at 2:41am

And ofcourse, that worked, thanks Cheese :)

<span>$Event.Content</span>