I want to use the CGCalendar module for displaying the availability of a hotel. The easiest way seemed to me by adding a class to the <td> by displaying the category name. But I can't get it to work.
I can display the category-id BETWEEN <td> </td> but not actually as a class of the <td> itself. I've used some code I found with the searchfunction at an old topic from back in 2014 and came up with this;
Code: Select all
<td {if isset($day.class)}class="{$day.class} cal-day"{/if}>
{if isset($day.events.0)}<a class="calendar-daylist" data-day="{$day.date}" href="{$day.ni_url}">{$key}</a>
{foreach from=$day.events item=event}
{foreach from=$event.categories key=category item=item}
<span class="{$item.category_name}"></span>
{/foreach}
{/foreach}
{else}{$key}{/if}
</td>
Code: Select all
<td class="category-id cal-day">
<span class="category-id">day number</span>
</td>