Support

Home Forums Events Calendar Add-on Calendar Add on

Calendar Add on

Posted: December 5, 2023 at 2:51 pm


Brilliant Baby & Beyond

December 5, 2023 at 2:51 pm

Hello,
We just purchased the calendar addon. The calendar is very crowded in the blocks because our title of our events are very long. We need these long titles to identify the class. Is there a customization that we could use to truncate the title in the calendar only? For example we would only want the name of the class, ages, and time. (not the sessions listed or the time listed twice etc…)
Thank you
Laura


Garth

  • Support Staff

December 6, 2023 at 9:51 am

This reply has been marked as private.


Brilliant Baby & Beyond

December 6, 2023 at 2:31 pm

yes it is


Rio

  • Support Staff

December 6, 2023 at 8:05 pm

That is tricky, but you can customize the title using this filter.

The name of the event that’s displayed in the calendar is filterable via the WordPress plugin API

FHEE__EE_Datetime_In_Calendar__to_array_for_json__title

you can use php string manipulation, you can check some info here.
https://reintech.io/blog/working-with-php-strings-manipulation-and-regular-expressions


Brilliant Baby & Beyond

December 19, 2023 at 9:29 am

Thank you…we will try this.


Rio

  • Support Staff

December 19, 2023 at 5:47 pm

Awesome, if you need anything, feel free to reach us again.

thanks


Brilliant Baby & Beyond

December 29, 2023 at 2:23 pm

Hello,

So, this would only work if the titles of events each had exactly the same number of characters in them. Our titles are all different lengths.

Do you know if Event Expresso would be able to support additional custom fields that could then be used on the grid style calendar? That might be another option where we could see about adding another title field for each event that would only be used in the grid style calendar display.

Not sure if that would have a lot of other potential unintended consequences though.

Any other ideas would be appreciated. As we are paying for the calendar and can not use it.
thank you
Laura


Tony

  • Support Staff

December 29, 2023 at 3:17 pm

So, this would only work if the titles of events each had exactly the same number of characters in them. Our titles are all different lengths.

Sorry, I don’t follow here, may I ask why the length of the titles matters in regards to that hook?

You only want the event name to be used in the calendar? Something like this:

https://github.com/eventespresso/ee-code-snippet-library/blob/797ed8242e9c97824d6d49d4c6d6ee42974b7ae1/addons/eea-calendar/tw_ee_EE_Datetime_In_Calendar__to_array_for_json__title.php

If you add more specifics on the issues with using the hook I can likely help point you in the right direction.


Brilliant Baby & Beyond

December 31, 2023 at 1:15 pm

Hello,
Our event titles are long which works for most of our needs, however when displaying them in the grid style calendar there just isn’t enough room. The boxes look overwhelmingly crowded with duplicate information in each date/time slot

So this is what is in one block: (which includes our long title)
“MOVEMENT MUSIC & MESSY PLAY 10 to 24 months – Sundays @ 10am November Session 10:00am to 10:45am” We do not need all of this to show in the calendar view (but I must have this for the titles in the events in Event Espresso.) All that needs to be on the calendar in this example would be ” MOVEMENT MUSIC & MESSY PLAY 10 to 24 months 10am to 10:45am” The rest we would like to remove.

We added the hook to the functions.php file for the site and it really didn’t do anything.

thank you


Rio

  • Support Staff

January 1, 2024 at 10:07 pm

This reply has been marked as private.


Brilliant Baby & Beyond

January 2, 2024 at 9:43 am

This reply has been marked as private.


Rio

  • Support Staff

January 2, 2024 at 10:17 pm

So this is what is in one block: (which includes our long title)
“MOVEMENT MUSIC & MESSY PLAY 10 to 24 months – Sundays @ 10am November Session 10:00am to 10:45am” We do not need all of this to show in the calendar view (but I must have this for the titles in the events in Event Espresso.) All that needs to be on the calendar in this example would be ” MOVEMENT MUSIC & MESSY PLAY 10 to 24 months 10am to 10:45am” The rest we would like to remove.

it seems you have to use string manipulation? if you have the same pattern for all of your event, you can use something like this.

function my_custom_calendar_filtered_title(
$original_title, $datetime_in_calendar
) {
$newtitle=$datetime_in_calendar->event()->name();

$finddash=’-‘;
$strpos_dash = strpos($newtitle, $finddash);

if(!$strpos_dash){
$strpos_dash = strlen($newtitle);
}

$renewtitle = substr( $newtitle, 0, $strpos_dash );
return $renewtitle;
}
add_filter(
‘FHEE__EE_Datetime_In_Calendar__to_array_for_json__title’,
‘my_custom_calendar_filtered_title’,
10,
2
);

Thanks


Brilliant Baby & Beyond

January 3, 2024 at 4:39 pm

This reply has been marked as private.


Brilliant Baby & Beyond

January 3, 2024 at 4:39 pm

This reply has been marked as private.


Rio

  • Support Staff

January 3, 2024 at 4:52 pm

Awesome! if you need anything, feel free to reach us again.

The support post ‘Calendar Add on’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso