Support

Home Forums Event Espresso Premium Events Table and Espresso Calendar Conflict

Events Table and Espresso Calendar Conflict

Posted: January 7, 2014 at 11:58 am


David Whitlock

January 7, 2014 at 11:58 am

I have the expresso calendar on my homepage.
I have the basic event table in the sidebar in a widget.

The filter by category dropdown does not function correctly. It will not show events in a specific category or display show all once I have selected a category.

If I view the basic events table in the sidebar on a page without the expresso calendar. The dropdown works fine.

So I assume there is a conflict between the calendar and the events table.

Can you please help me fix this?


David Whitlock

January 7, 2014 at 12:02 pm

I have narrowed down the issue to having the filter activated on the calendar.
When I have a drop down filter on the calendar, it conflicts with the drop down filter on the event table.

Hoe do I fix this?


Josh

  • Support Staff

January 7, 2014 at 3:52 pm

Hi David,

Do you want both the event table and the calendar to display on the same page?


David Whitlock

January 7, 2014 at 3:54 pm

Yes.


David Whitlock

January 7, 2014 at 3:54 pm

One in page and one in sidebar widget space


Josh

  • Support Staff

January 7, 2014 at 6:45 pm

Hi David,

Can you post a link to your home page so we can look into this?


David Whitlock

January 7, 2014 at 7:38 pm

http://jccevents.net


Josh

  • Support Staff

January 7, 2014 at 7:42 pm

Hi David,

If you open up the espresso-custom-template’s index.php file there’s a bit of jQuery at the bottom of the file. There is a line that reads:

var ee_filter_cat_id = jQuery("option:selected").attr('class');

that you can try changing to:

var ee_filter_cat_id = jQuery("#ee_filter_cat option:selected").attr('class');

Which should resolve the conflict.


David Whitlock

January 7, 2014 at 8:11 pm

Worked like a charm! Thanks!


David Whitlock

January 7, 2014 at 8:15 pm

Just noticed a new conflict.

I added a custom field with a meta box.
event_ceu

It is working correctly and displays in the sidebar on all pages except the homepage.
I believe this is another conflict with the calendar jquery.

Any suggestions?


David Whitlock

January 7, 2014 at 8:17 pm

You can see the event_ceu working on this page:
http://jccevents.net/event-registration/?ee=1

It is working in the event details and it is working in the sidebar in the widget.

But it doesn’t work in the widget on any other page, including the homepage.


Josh

  • Support Staff

January 7, 2014 at 9:15 pm

Hi David,

It’s likely not a conflict with the calendar jQuery since your custom fields are only being displayed on single event pages. (eg. There isn’t a calendar on the contact us page)

When you modify the event table template to include a new column you’ll need to make sure the event_meta or other variables you are using are set. They’re set on the registration page, but not on other pages. The way forward is to be sure they’re set within the event table template. It may help to set the global variable for the event_meta within the table template like this:

global $event_meta;


David Whitlock

January 8, 2014 at 5:03 am

Josh,

Thanks for the suggestion, but I am not clear how to implement it. I am not an expert in php.

Can you be a little more specific how and where I should include:
global $event_meta;

into the table template

Thanks!


Dean

January 8, 2014 at 5:40 am

Hi,

In the events table index.php about line 12 you should see

global $this_event_id, $events, $wpdb;

Change it to read

global $this_event_id, $events, $wpdb, $event_meta;

And that will make the $event_meta variable available to you.


David Whitlock

January 8, 2014 at 6:28 am

Thanks.
I did exact as you suggested, but it didn’t fix the issue. 🙁

Please take another look.


Dean

January 8, 2014 at 6:36 am

I see, well it doesn’t work on any page unless there is the events. You may need to add that global $event_meta to the sidebar.php or perhaps to the page.php (both part of your theme).


David Whitlock

January 8, 2014 at 6:44 am

Dean,

I add the following: <?php global $this_event_id, $events, $wpdb, $event_meta; ?>

to both the sidebar.php and the page.php

no difference.

Am I doing something wrong?


Josh

  • Support Staff

January 8, 2014 at 11:32 am

Hi David,

I don’t think it’s necessary to add the global to page.php. It’s best to add it to the event table template. Simply adding the global variable may not help depending on the code that you wrote to include the extra column.

You asked us to take another look, but without seeing the PHP code that you’re trying to use we’re kind of in the dark with this. If you’d like to post your modified code in a pastebin or a gist and link to it here we can at least take a look and offer suggestions from there. Please understand that this support thread started out with another issue and the issue you are having now has to do with a customization that you made.


David Whitlock

January 8, 2014 at 12:14 pm

Josh,

Thanks for your help with this issue. I am not really sure what is going on.
I am using the Event Meta Fields, but there seems to be a conflict.

The CEU column in the sidebar widget is not showing on any page but the registration page
It works here: http://jccevents.net/event-registration/?ee=1

So I assume that the registration page is loading some code that allows the Meta Field to work in both locations.

Here is a link to the index.html code for the custom table in the sidebar widget:
https://www.dropbox.com/s/33rewrme50pl6s0/index.php

Here is a link to the registration page code:
https://www.dropbox.com/s/y46mwywcviqjwnp/registration_page_display.php

I REALLY appreciate your help with this. It is driving me crazy!


Josh

  • Support Staff

January 8, 2014 at 1:46 pm

Hi David,

It’s not really a conflict, but you are missing a few things here. In order to use the EE_META shortcode for a specific event it needs to be within the foreach loop (so the meta can be pulled for each event) It also needs to be unserialized. If you look in the template you’ll see the loop starts on line 41. You can add the meta variables there after the loop starts like this:

foreach ($events as $event){
global $event_meta;
$event_meta = unserialize($event->event_meta);


David Whitlock

January 8, 2014 at 7:12 pm

Success!!! Thanks for sticking with me on these issues!

The support post ‘Events Table and Espresso Calendar Conflict’ 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