Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » Event calendar Q #1

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 934 Views
  • Funktion
    Avatar
    Community Member
    10 Posts

    Event calendar Q #1 Link to this post

    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.

    FunK

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event calendar Q #1 Link to this post

    in your mysite/templates/layout/calendar.ss, just evaluate whether the date is in the past.

    <% if StartDate.InPast %>class="past"<% end_if %>

  • Funktion
    Avatar
    Community Member
    10 Posts

    Re: Event calendar Q #1 Link to this post

    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

    Thanks,

    FunK

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event calendar Q #1 Link to this post

    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>

  • Funktion
    Avatar
    Community Member
    10 Posts

    Re: Event calendar Q #1 Link to this post

    Works like a charm, thankyou so much.

    934 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.