CGCalendar Category as class

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
brentnl
Power Poster
Power Poster
Posts: 493
Joined: Mon May 11, 2009 4:35 pm

CGCalendar Category as class

Post by brentnl »

Hi,

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>
I would like to have something like this, so I could give background-color to the whole <td>.

Code: Select all

<td class="category-id cal-day">
<span class="category-id">day number</span>
</td>
Post Reply

Return to “Modules/Add-Ons”