Support

Home Forums Event Espresso Premium Custom View Table Problems/Calendar Legend Restrictions

Custom View Table Problems/Calendar Legend Restrictions

Posted: May 1, 2015 at 10:22 am

Viewing 3 reply threads


Renee deVilliers

May 1, 2015 at 10:22 am

Hi, I hope maybe you can help me with something we’d like to do in terms of listing our events.

We would like to create a page – like this one, or close to it: http://www.allaboutdogs.ca/upcomingclasses
(password = 1)

For the most part the page is manually created, however at the bottom is a test custom view list for First Paw Forward class.

To get this specific list to show, I have had to create a special category (that is used only on the first in a recurring series of classes designate to First Paw Forward. This means only the first is given TWO categories. Which is NOT ideal. (we do NOT want ALL the classes in a recurring class to appear in the list, only the FIRST CLASS in the series to show in the list.

So, my problem is twofold:

1. The Venue doesn’t change. So I’d like to remove that from the table all together. And have the same headers as the manually inputted tables above. Class (Not “event”), Date, Start Time-End Time, “Register” link (not “view details”).

2. The Calendar becomes a problem if we handle the list display using this second category method (which really is a work-around that is entirely cumbersome, much like the alternate registration page work-around to have all recurring events go to the first class’s registration page). The legend at the top of the calendar becomes an issue. I don’t WANT the workaround categories (that we are going to put the first event’s in only) to appear on the calendar at all. I want to exclude them entirely.

How would we handle both of these problems to achieve a page that can summarize cleanly our upcoming classes that are NEW. We would create multiple lists on the page to make it easy for users, as we have done to manually list the classes on this trial page.

Please advise.

Thanks


Dean

May 4, 2015 at 5:06 am

Hi,

1) The best way to achieve this would to be to create a custom template. We have a basic guide here (https://eventespresso.com/wiki/custom-templates-add-on-create-a-template/) but you will need to know some PHP to achieve it.

2) The recurring event display is tricky. There really isn’t a way to exclude some events and not others apart from manually adding a category and doing what you’re doing.

In theory you could code it into the custom template to not show the event if the first in the series has been displayed already, but this would definitely require custom development.

The legend isn’t filterable unfortunately, as such if you add a category it will show in the legend. So the only way I can foresee avoiding that would be the custom development.

I can ask for a filter to be added there, but 99% of EE3 feature requests are on permanent hiatus as we swap over to EE4.

Sorry that this isn’t much in the way of an answer, but I can’t see an alternative to what you’re doing now, except custom development.


Renee deVilliers

May 4, 2015 at 3:18 pm

Hi Dean,

So, I am lean on php knowledge, unfortunately. Is there no way I can get some help with at least which file to start from, and duplicate to start editing as a custom template? Or how can I eliminate the vent column from displaying by editing the existing file it is referencing to display the chart? So guidance on where to start would help, and on what to remove etc.

So for the calendar, I can’t tell it to NOT show certain category IDs? In other words, edit the file manually to output all categories except “x,y,z” for example?

I may have someone who can review our needs, but I’d like to be able to point them to the right files to review, can you please let me know.

Thanks


Dean

May 5, 2015 at 3:48 am

Hi,

OK, so if you follow that guide and create a duplicate template, make sure it loads fine when using the [EVENT_CUSTOM_VIEW template_name=”XXX”] shortcode where XXX is the custom template name.

Once you have that exact duplicate working, you can easily start modifying it. TO remove the venue column for instance:

Deleting this line:
<th class="th-group"><?php _e('Venue','event_espresso'); ?></th>

and this line
<td class="venue_title venue-<?php echo $event->id;?>"><?php echo stripslashes($event->venue_name) ?></td>

Regarding the calendar, unfortunately that is one of the flaws with the EE3 calendar, there isn’t a way to exclude events by category.

You *could* edit the calendar files directly, but we do NOT recommend it, and we do NOT support it.

If you still want to you could for example edit /wp-content/plugins/espresso-calendar/espresso-calendar.php at araound line 552. It should say:

foreach ( $events_data as $event ) {

Below that you could add something like:

$cat_temp = explode(',', $event->category_id);
//this is the list of category IDs to exclude
$excludeme = array( 1, 2, 3);
$x = 0;
//http://php.net/manual/en/function.in-array.php
foreach ($cat_temp as $cat) {
	if( in_array($cat, $excludeme) ) {
	$x = 1;
	}
}
if($x == 1) {
	break;
}

That code is just an example and should not be used on a live site without thorough testing!

Any edits made to the calendar will be over written when the calendar is updated.

Viewing 3 reply threads

The support post ‘Custom View Table Problems/Calendar Legend Restrictions’ 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