I am having this same problem, how did you fix it?
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.
UpcomingEvents() and RecentEvents() are now decorated into your SiteTree, so you can call those functions on any template.
UpcomingEvents works fine, nothing is returned when I use RecentEvents. It's quite odd.
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