help to better help you:
Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!
Event Status in Weekcal
Event Status in Weekcal
5 hours 26 minutes ago
Hi, I've a question about the weekcal menu item : Is there an option anywhere to display an event status i.e. Cancelled / Postponed the same way that the Teaser Module does ?
I'm not particularly bothered about it showing Scheduled, just those that may have been on the list and then moved... I know that to unpublish will not display them and that clicking on the item will take you to it's page where status is displayed,
Thanks.
I'm not particularly bothered about it showing Scheduled, just those that may have been on the list and then moved... I know that to unpublish will not display them and that clicking on the item will take you to it's page where status is displayed,
Thanks.
Please Log in or Create an account to join the conversation.
Re: Event Status in Weekcal
3 hours 6 minutes ago - 2 hours 54 minutes ago
Hi, Short answer: no, there is currently no option for this in the week calendar (or the monthly and year calendar). The menu option *Show status indicators* only exists for the list-type views (category, day, events list and blog, search, venue, types).
The calendar views only show the published/unpublished icon. You can get it with a small template override, though. It uses the same status badge as the Teaser module, with the same colours from *JEM Settings → Basic → Module status*.
Only Cancelled, Postponed, Rescheduled and Moved online get a badge; normal (scheduled) events stay as they are.
**1. Create the override** Copy `components/com_jem/views/weekcal/tmpl/responsive/default.php` to `templates/YOUR_TEMPLATE/html/com_jem/weekcal/responsive/default.php` (If your JEM layout style is not "responsive", use `views/weekcal/tmpl/default.php` and `html/com_jem/weekcal/default.php` instead. The edits are the same.)
**2. Find this line** (about 80 to 130 lines down): ```phpforeach ($this->rows as $row) :``` and add these lines directly **above** it: ```php// Show event status badges (Cancelled, Postponed, Rescheduled, Moved online)JemOutput::prepareModuleEventStatuses($this->rows);JemHelper::loadModuleStatusAssets();\Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager()->addInlineStyle( 'div#jem .eventcontentinner .jem-module-event-status-badge{color:var(--jem-module-status-color,#fff) !important;margin-inline-start:0;}');``` (The inline style is needed because the calendar stylesheet forces the text colour of every span in the calendar cell, which would make the badge text black.)
**3. Find this line** (further down, in the same loop): ```php$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$contact.$eventstate, $eventdate, $row->title . $statusicon, $detaillink, 'editlinktip hasTip', $timetp, $category->color);``` and replace it with: ```php$statusBadge = '';if (in_array($row->module_event_status ?? '', array('cancelled', 'postponed', 'rescheduled', 'moved_online'), true)) { $statusBadge = ' ' . JemOutput::moduleEventStatusBadge($row);}$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$contact.$eventstate, $eventdate, $row->title . $statusicon . $statusBadge, $detaillink, 'editlinktip hasTip', $timetp, $category->color);``` If you only want Cancelled and Postponed, remove `'rescheduled'` and `'moved_online'` from the list. The result looks like the attached screenshot: the badge appears under the title in the calendar cell.
**Note for JEM 5.0.2 RC4 / 5.1.0 beta 7 testers:** in those test versions, the weekcal template contains this line near the top: ```phprequire_once __DIR__ . '/../../../../helpers/calendardaylink.php';``` In an override that path is wrong and the page gives an error 500. Change it to: ```phprequire_once JPATH_SITE . '/components/com_jem/helpers/calendardaylink.php';``` On 5.0.1 that line does not exist and nothing needs to be changed ther
Remember that an override is not updated with JEM: after a JEM update, compare your override with the new core file. Tested on JEM 5.0.2 RC4 and 5.1.0 beta 7 (Joomla 6.1, Cassiopeia, responsive layout).
The calendar views only show the published/unpublished icon. You can get it with a small template override, though. It uses the same status badge as the Teaser module, with the same colours from *JEM Settings → Basic → Module status*.
Only Cancelled, Postponed, Rescheduled and Moved online get a badge; normal (scheduled) events stay as they are.
**1. Create the override** Copy `components/com_jem/views/weekcal/tmpl/responsive/default.php` to `templates/YOUR_TEMPLATE/html/com_jem/weekcal/responsive/default.php` (If your JEM layout style is not "responsive", use `views/weekcal/tmpl/default.php` and `html/com_jem/weekcal/default.php` instead. The edits are the same.)
**2. Find this line** (about 80 to 130 lines down): ```phpforeach ($this->rows as $row) :``` and add these lines directly **above** it: ```php// Show event status badges (Cancelled, Postponed, Rescheduled, Moved online)JemOutput::prepareModuleEventStatuses($this->rows);JemHelper::loadModuleStatusAssets();\Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager()->addInlineStyle( 'div#jem .eventcontentinner .jem-module-event-status-badge{color:var(--jem-module-status-color,#fff) !important;margin-inline-start:0;}');``` (The inline style is needed because the calendar stylesheet forces the text colour of every span in the calendar cell, which would make the badge text black.)
**3. Find this line** (further down, in the same loop): ```php$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$contact.$eventstate, $eventdate, $row->title . $statusicon, $detaillink, 'editlinktip hasTip', $timetp, $category->color);``` and replace it with: ```php$statusBadge = '';if (in_array($row->module_event_status ?? '', array('cancelled', 'postponed', 'rescheduled', 'moved_online'), true)) { $statusBadge = ' ' . JemOutput::moduleEventStatusBadge($row);}$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$contact.$eventstate, $eventdate, $row->title . $statusicon . $statusBadge, $detaillink, 'editlinktip hasTip', $timetp, $category->color);``` If you only want Cancelled and Postponed, remove `'rescheduled'` and `'moved_online'` from the list. The result looks like the attached screenshot: the badge appears under the title in the calendar cell.
**Note for JEM 5.0.2 RC4 / 5.1.0 beta 7 testers:** in those test versions, the weekcal template contains this line near the top: ```phprequire_once __DIR__ . '/../../../../helpers/calendardaylink.php';``` In an override that path is wrong and the page gives an error 500. Change it to: ```phprequire_once JPATH_SITE . '/components/com_jem/helpers/calendardaylink.php';``` On 5.0.1 that line does not exist and nothing needs to be changed ther
Remember that an override is not updated with JEM: after a JEM update, compare your override with the new core file. Tested on JEM 5.0.2 RC4 and 5.1.0 beta 7 (Joomla 6.1, Cassiopeia, responsive layout).
JEM 5.1.0 + Joomla 6
Last edit: 2 hours 54 minutes ago by Bluefox.
Please Log in or Create an account to join the conversation.
Time to create page: 0.568 seconds