C5 v8.5 Event List View Template to Share with community

Permalink
This is my hacked up event list view template for the built in Calendar in v8.5 . It casts the info in a nice Bootstrap 3 layout, (styling will vary from my screenshot according to your CSS, but the basic layout should stick), with some font awesome icons.

The list pulls some custom event attributes that are not part of the default setup:
event_learn_more_link
event_location
event_categories

The notable revisions are this event list shows the time of the event and distinguishes All Day from times for multiday events.

It also moves the View All to the top and makes it a button with a count of events shown. Which may not work correctly. You'll see my comments within. If anyone wants to correct or improve on it, please share back.

Hope this helps someone!

Here's the template (view.php), pardon my messy style:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
// >>> ^^^ <<< >>> View for Event List 2020
if ($calendar) {
    $pagination = $list->getPagination();
    $pagination->setMaxPerPage($totalToRetrieve);
    $events = $pagination->getCurrentPageResults();
    //count all events, not just what is shown on page so we can make a number badge. This may not function as events drop off list, will have to watch it. -td
    $allEvents = $list->getPagination();
    $allEvents->setMaxPerPage(100);
    $totEvents = $allEvents->getTotalResults();
    if ($canViewCalendar) {
        $service = Core::make('helper/date');
        $c = Page::getCurrentPage();
        $cID = $c->getCollectionID();


And here is the view.css. Other styles in screen cap come from my theme.
div.ccm-block-calendar-event-list {
    margin-bottom: 1em;
    clear: both;
    font-family: 'Roboto Condensed';
}
div.ccm-block-calendar-event-list-wrapper {
    margin-bottom: 10px;
    clear: both;
}
div.ccm-block-calendar-event-list-event-date {
    width: 100%;
    height: 100%;
    float: left;
    /*margin-right: 10px;*/
     margin-bottom: 1em;

1 Attachment

tduncandesign
 
tallacman replied on at Permalink Reply
tallacman
Thanks. You could also upload the template as an attachment.

s