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

Calendar event module - upcoming events on homepage?


Go to End


36 Posts   9005 Views

Avatar
nickysix

Community Member, 4 Posts

6 May 2010 at 7:01am

I am having this same problem, how did you fix it?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

6 May 2010 at 7:06am

UpcomingEvents() and RecentEvents() are now decorated into your SiteTree, so you can call those functions on any template.

Avatar
nickysix

Community Member, 4 Posts

6 May 2010 at 7:28am

UpcomingEvents works fine, nothing is returned when I use RecentEvents. It's quite odd.

Avatar
Kiwipearls

Community Member, 34 Posts

27 March 2012 at 12:23pm

I am having a hard time trying to get this to appear on my side bar.

My homepage is formated differently from the rest of the site.

my HomePage.php file looks like this:

<?php
/**
 * Defines the HomePage page type
 */
 
class HomePage extends Page {
   static $db = array(
   );
   static $has_one = array(
   );
}
 
class HomePage_Controller extends Page_Controller {
     function UpcomingEvents() 
{ 
return DataObject::get_one("Calendar")->upcomingEvents(5); 
}

}

and my HomePage.ss has this for the sidebar I created

<div id="right">
         		 <div id="Sidebar" class="typography">$Page(notice-board).Content</div>
				 <% control UpcomingEvents %> 
<h3>$_Dates</h3> 
<h4><a href=$Event.Link">$Event.Title</a></h4> 
<% end_control %>
				 		
    	</div> 

I get this error on the page:

This page contains the following errors:
error on line 180 at column 12: AttValue: " or ' expected
Below is a rendering of the page up to the first error.

And it displays ugly data right up to the first date of the first event in the calendar:

<span class="dtstart" title="20120330T000000-04:00">Mar. 30, 2012</span>
<span  class="dtend" title="20120331T000000-04:00"></span>

The second line dtend data is not displayed on the page.

I eagerly look forward to getting your help on this.

my test site for now is http://demo.senilityguild.com

Go to Top