0

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

Thanks

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

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:

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

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

| improve this answer | |
  • neither of those tags render {display_each_day} {if day_in_current_month} <td class="day_cell">{day_event_count}{event_count}< – Macker999 Oct 16 '14 at 15:51
  • I used js and i got it to work $('td .event').closest('td').addClass('has_event'); – Macker999 Oct 16 '14 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 Oct 20 '14 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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