Support

Home Forums Event Espresso Premium Calendar Customization – Override files?

Calendar Customization – Override files?

Posted: October 15, 2012 at 12:17 pm

Viewing 3 reply threads


markal

October 15, 2012 at 12:17 pm

We’ve recently been able to override the calendar.css file by placing our custom calendar.css file in a wp-content/uploads/espresso/css directory. This is not in congruence with the online tutorial, that leaves out the /css folder. https://eventespresso.com/wiki/calendar/ , so I thought it may be helpful for others to make reference to this.

We’d like to be able to customize the display of the calendar even further, and it looks like the calendar portion of the EE solution is a third-party script/plugin. I’ve read up on the fullcalendar instructions, here: http://arshaw.com/fullcalendar/docs/, and it seems we would need to override files like espresso-calendar.php and espresso-calendar-widget.php.

I’ve tried following a similar override structure of placing the espresso-calendar.php file in the wp-content/uploads/espresso/ directory, but that did not seem to work. Is there a different directory structure that would enable this approach to work?

Is there a way to override other files for the calendar display? What are recommendations and guidelines for customizing the calendar beyond what is capable within css (i.e. the functions in the espresso-calendar.php file)?

Thanks so much for any advice anyone may have!


markal

October 15, 2012 at 12:25 pm

I thought it might be helpful to also offer an example of a customization we would like to make.

In the header of the calendar page display (month view) is the month. So for the current month, it displays “October 2012′. We would like it to read ‘Our Company Name Calendar – October 2012’.

I would normally look to where the month/date is getting inserted and prepend the desired text. If it’s possible to avoid customizing core files (i.e. files that would be overwritten when upgrading the EE Calendar plugin), that would be best.

How would anyone recommend making this type of customization?


Josh

  • Support Staff

October 15, 2012 at 3:00 pm

I would recommend doing this with some jQuery to avoid overwriting the calendar plugin code. The calendar plugin cannot be overridden via the /wp-content/uploads/espresso/templates folder, although you can override any of the pluggable functions with the custom files add-on. Basically what that means is where you see something like this:

if (!function_exists('espresso_calendar')) {
 //calendar code here
}

You can copy the entire function over to the custom files add-on’s custom functions file. That’s a lot of code to maintain with future releases of the calendar though,so I would not recommend doing this for a minor change like adding some text. Instead, you could do something like create a WordPress page template for the calendar page(s) and add a line of jQuery like this directly to the page template (or a custom footer.php template that only loads on the calendar page:

<script>jQuery('.fc-header-title').prepend('<h2>Our Company Calendar</h2>');</script>


markal

October 15, 2012 at 3:36 pm

Excellent! Thanks so much for clearing things up for me! I used your jquery script, however instead of prepending another h2 tag, I used a span tag. This is because the Previous and Next month buttons use javascript to update the h2 tag on the page, so it’s best to only have one h2 tag on the page.

Thanks again for your assistance!

Viewing 3 reply threads

The support post ‘Calendar Customization – Override files?’ 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