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 - Upcoming Events Control


Go to End


17 Posts   5667 Views

Avatar
churika

Community Member, 29 Posts

8 June 2010 at 11:46am

Edited: 08/06/2010 11:49am

					<ul style="margin: 0; padding: 0; width: 525px;">
						<% control UpcomingEvents(4, events) %>
							 <li style="overflow: hidden; margin-bottom: 10px; height: 100px;">
								 <div class="eventleft" style="float: left; width: 150px;">
								 	<a href="$Link">$ImageURL.SetWidth(125)</a>
								 </div>								 
								 <div class="eventright">
								 	<a href="$Link">$Title</a><br />
									<p>$_DatesText</p>
								 	<p>$Content.LimitWordCount(15)</p>
								 </div>								 	
							 </li>
						<% end_control %>
					</ul>

$_DatesText is $_Dates function just renamed
$ImageURL is a data object I added

Avatar
UncleCheese

Forum Moderator, 4102 Posts

8 June 2010 at 11:51am

If you're site isn't in dev mode. the URL debugging tools don't work, FYI..

Avatar
churika

Community Member, 29 Posts

8 June 2010 at 11:55am

Director::set_dev_servers(array(
'localhost',
'127.0.0.1',
));

That is turned on in _config.php

Do i need to do something further to be in dev mode?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

8 June 2010 at 12:21pm

Director::set_environment_type('dev');

Avatar
UncleCheese

Forum Moderator, 4102 Posts

8 June 2010 at 12:25pm

I don't think $Content is a valid field for a CalendarDateTime object. Make sure you're using the $Event accessor.

$Event.Content, or use the shortcut $EventContent which has some smarts in it to get the content from the related event or the Description field if it's an announcement.

Avatar
churika

Community Member, 29 Posts

8 June 2010 at 2:08pm

Edited: 08/06/2010 2:08pm

Thx, using the Events. worked on both ImageURL and Content

and the dev thing worked too i was able to see which one wasn't able to be accessed

you're the man

Avatar
Spiggley

Community Member, 12 Posts

9 July 2010 at 5:32am

I've just started using event Calendar and am impressed. If I am using $Event.Content within UpcomingEvents events, how can I use a word limit on this? as say $EventContent.LimitWordCount(10) doesn't work.

Also, (and apologies if this has been asked before) - what is the best way to override calendar css? - as putting in my theme is not working.

Sorry for the noob questions - with thanks

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 July 2010 at 5:55am

<% control Event %>
$Content.LimitWordCount(10)
<% end_control %>