1 (edited by Smorg 2025-03-19 19:37:36)

Topic: Adding the name of the subcatergory to the event title

I have found WHERE to add this, but not sure what variable to use.

In context, I have too many subcategories to be able to use colours to distinguish between them, as the calendar is on display in the room.

Supplementary, where are drop downs for categories being built? I want to be able to hide a category on a particular day.

Thanks

Re: Adding the name of the subcatergory to the event title

I have found the same variable is used when hovering over the event.  The div id is htmlPop if this helps you

Re: Adding the name of the subcatergory to the event title

Hi Smorg,
To add the subcategory to the event title in month view can be achieved as follows (for LuxCal 5.3.3).:
The subcategory name for an event is held in the variable $evt['snm'].
So edit the file views/month.php" and add just below line 26 . . . .

$snm = $evt['snm'] ? " - {$evt['snm']}" : '';

and change line 28 from . . . .

echo "<div {$onClick}{$popAttr} title=\"{$title}\">{$chBox}{$event}</div>\n";

to . . . .

echo "<div {$onClick}{$popAttr} title=\"{$title}\">{$chBox}{$event}$snm</div>\n";

In other words add "$snm" after "{$event}".

The category /subcategory drop-down menus for the Add / Edit event window are produced in the "pages/eventform1.php" script, functions catMenu (line 24) and scatMenu (line 43) respectively.

Roel

Re: Adding the name of the subcatergory to the event title

Thanks very much for that,

Re: Adding the name of the subcatergory to the event title

So, I think I am running an older version. I found the file to edit (was in views, not pages), but $snm is displaying as an unknown variable.

In settings, it's showing 5.1.0M

I assume that's the version number. Can you still help?

Thanks

Re: Adding the name of the subcatergory to the event title

For Luxcal V5.1.0:
Edit the file views/month.php" and add just below line 24 . . . .

$snm = $evt['snm'] ? " - {$evt['snm']}" : '';

and change line 26 from . . . .

echo "<p {$onClick}{$popAttr} title=\"{$title}\">{$chBox}{$event}</p>\n";

to . . . .

echo "<p {$onClick}{$popAttr} title=\"{$title}\">{$chBox}{$event}{$snm}</p>\n";

In other words add "{$snm}" after "{$event}".