Calendar Event Categories Class?

  • Betroffene Version
    WoltLab Suite 3.1

    Hello, does anyone know if there is a class that is applied to calendar events by their categories?

    I feel like their has to be, they have access lists, colors for the event ect. However I cannot find any data ID for the events that state their category.

    I would like to add FA icons to the events, depending on their category. However, cant seem to find a way to do it by the category. I can do it be the event just fine, but not the category.

  • I am unsure if I correctly understood what you are searching for but if you have an Event object, you can access the category via $event->getCategory(), and if you have an EventDate object, you can access it via $eventDate->getEvent()->getCategory().


    I'm trying to add FA icons, in the Events, before the title of the event using CSS.

    I have attached an Example, in my example pic. I am having people add emojis to the front of the event title. I would rather, add a FA icon, to the front of every event, in a category.

    • Offizieller Beitrag

    Disclaimer: untested :)


    Edit the template calendar.tpl in the ACP, more specifically the following line:

    Code: calendar.tpl
    <li{if $_dayItem.margin} style="margin-top: {@$_dayItem.margin}px"{/if}{if $_dayItem.cssClassNames} class="{$_dayItem.cssClassNames}"{/if}><a href="{link application='calendar' controller='Event' object=$eventDate}{/link}" class="calendarEventLink{if $eventDate->getTextColor()} calendarEventTextColor{@$eventDate->getTextColor()|ucfirst}{/if}{if $eventDate->cancelTime} calendarEventCanceled{/if}" data-event-date-id="{@$eventDate->eventDateID}"{if $eventDate->getBackgroundColor()} style="background-color: {@$eventDate->getBackgroundColor()}"{/if}>{$eventDate->getEvent()->subject}</a></li>

    Before the {$eventDate->getEvent()->subject}, you can add some code like (there is the trailing whitespace!)

    Code
    {if $eventDate->getEvent()->categoryID == 12}<span class="icon icon16 fa-plus"></span>{/if} 

    Where 12 ist just an example of the relevant category id and fa-plus also just an example of a FontAwesome icon.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!