I've started playing around with SS recently, but I'll look into it and when I figure it out myself I'll let you know.
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.
Did that latest revision work for you?
function extendAnnouncement()
{
$this->removeAnnouncementField('Content');
$this->addAnnouncementField(new SimpleHTMLEditorField('Content'));
}
Will not work: Announcement is a property of WorkshopHolder, not of Workshop (from Calendar/not from CalendarEvent)
And there are other reasons to have seminars (we have 15-20 of them + 3-5 external, i.e. redirects) as WorkshopHolder and meetings as non-repeating events.
So, my question is: How to create WorkshopAll page which had WorkshopHolder pages as children and was listing their events?
Thanks
Victor
Of course it will work. The CalendarDateTime class has an abstract function extendAnnouncement() that you can use to add fields to the announcement popup. Did you try it? What error did you get? Be sure you're up to date on your SVN.
To make a Seminar holder you could do something as simple as:
class SeminarHolder extends Page
{
static $allowed_children = array('WorkshopHolder');
}
class SeminarHolder_Controller extends Page_Controller
{
}
SeminarHolder.ss
<% control Children %>
$Title
Upcoming Seminars
<% control upcomingEvents(5) %>
event info here
<% end_control %>
<% end_control %>
No, I want SeminarHolder behaved exactly as WorkshopHolder, but with a twist: it displays events associated with its children.
So I took WorkshopHolder.php and copied it to SeminarHolder.php with obvious replacement
Then I took WorkshopHolder.ss and copied it to SeminarHolder.ss and enveloped <% if Events %>....<% end_if %>:
<% control children %><% if Events %>....<% end_if %><% end_control %>
However CalendarWidget on this page does not filter.
Victor
Right, because the start and end date parameters come in from the URL and that is parsed in the controller. Once you get into <% control Children %> you are not in the page controller anymore.
Works perfectly for me now thanks!
I've checked in the patch for the "ghost dates" bug.