10378 Posts in 2194 Topics by 1710 members
|Go to End|
4 September 2009 at 10:51pm
Hi there, im new to SS,
My first question is about the event_calendar module.
I want to "grey out" (that is, disable) all dates that have passed, ie. all dates prior to the current date.
Even finding the current date is difficult, forgive me if im obtuse, but i need help.
More Questions to come, thanks for the help with my project.
5 September 2009 at 1:49am
in your mysite/templates/layout/calendar.ss, just evaluate whether the date is in the past.
<% if StartDate.InPast %>class="past"<% end_if %>
5 September 2009 at 2:20am
Thank you so much for a quick response,
Still not sure on how to implement this, will it work to disable all past dates??
Where in calendar.ss do i add the code?
Sorry to be stupid
5 September 2009 at 2:54am
Well you just want them greyed out, right? You don't want them hidden.
The first thing you need to do is copy the contents of event_calendar/templates/Layout/Calendar.ss and CalendarEvent.ss to your mysite (or theme dir) /templates/Layout. Silverstripe always looks in your theme directory first for a template and falls back on the module default if it's not there.
Run a flush, and then in your Events control you could just do something like this:
<h3 class="summary"><% if Announcement %>$EventTitle<% else_if StartDate.InPast %><span class="past">$EventTitle</span><% else %><a href="$Link">$EventTitle</a><% end_if %></h3>
5 September 2009 at 7:13pm
Works like a charm, thankyou so much.
|Go to Top|