I am using your the solspace calendar extension. I need to be able to highlight by adding a class to the td

I googled the request and I came across a few results but your archived forum seems to be not working any more

Is there a tag I can use {if event has results} etc


{display_each_day} {day format="%j"} {/display_each_day}

1 Answer 1


If you're using the {exp:calendar:cal} tag, within {display_each_day} ... {/display_each_day} you can use a {day_event_count} (http://www.solspace.com/docs/calendar/calendar/#day_event_count) in a conditional:

   <td class="{if day_event_count > 0}HIGHLIGHT CLASS{/if}">
      {day format="%j"}

Alternatively, {event_count} can also be used in some cases: http://www.solspace.com/docs/calendar/calendar/#event_count

  • neither of those tags render {display_each_day} {if day_in_current_month} <td class="day_cell">{day_event_count}{event_count}<
    – Macker999
    Commented Oct 16, 2014 at 15:51
  • I used js and i got it to work $('td .event').closest('td').addClass('has_event');
    – Macker999
    Commented Oct 16, 2014 at 15:52
  • Have you tried the {day_event_count} and {event_count} variables outside of the {if day_in_current_month}...{/if} conditional? JS is another workaround as well I guess.
    – Solspace
    Commented Oct 20, 2014 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.