Support

Home Forums Event Espresso Premium Customizations to Event List

Customizations to Event List

Posted: April 28, 2014 at 5:42 pm

Viewing 12 reply threads


mnbookarts

April 28, 2014 at 5:42 pm

Hi all — revisiting an issue I posted earlier but had to shelf, and the original thread is now closed to replies.

As part of our EE3 package, we purchased the Custom Templates Add-on, and I’m working on a comprehensive events list using Event Custom View (the table-style view).

In the Event Custom View, can I…
1) hide a column (we are the only venue)?
2) rearrange column order (e.g. displaying dates first)?
3) add a column (e.g. to display events’ category inline)?
4) include event listings with no Register / Add to Cart link?

As a possible workaround to (4), I found this thread:

https://eventespresso.com/wiki/selectively-hide-the-add-to-cart-link/

but I haven’t had a chance to experiment with that yet. Would love some input as to whether EE staff think that is the easiest method to create events that you do not register for. My purposes in this regard would be to list free public events where people can just drop in (exhibition openings, open houses, etc), so I don’t want to have a Register or Add to Cart link, even if we set the price to zero, because we don’t want to give people the impression that they have to register.

Any insights you can share will be much appreciated! Thanks!


mnbookarts

April 28, 2014 at 5:44 pm

The page in question is here (not linked from our site yet, I want to resolve some of these questions first):

http://www.mnbookarts.org/events/


Tony

  • Support Staff

April 29, 2014 at 3:15 am

Hi mnbookarts,

Question 1-3 would require modifications to the Template code. Are you comfortable with PHP/HTML/CSS?

Regarding question 4.

Do you want the events to only be visible within that table or would you like users to click to view more info anf view the event description?


mnbookarts

April 29, 2014 at 11:44 am

Hi Tony — yes and yes. I’ve made a handful of other modifications, so would be comfortable making these if you can point me in the right direction and help me identify the classes/IDs in question. And yes, ideally, we would like to have the ability to have them click through to the event description page. But if the best solution precludes that ability, we could live without it.

Thanks!


Tony

  • Support Staff

April 29, 2014 at 12:22 pm

If you’ve made other modifications my line numbers may not match up with yours.

If you open up events-table/index.php lines 30 – 37

<thead class="espresso-table-header-row">
	<tr>
		<th class="th-group"><?php _e('Event','event_espresso'); ?></th>
		<th class="th-group"><?php _e('Venue','event_espresso'); ?></th>
		<th class="th-group"><?php _e('Date','event_espresso'); ?></th>
		<th class="th-group"></th>
	</tr>
</thead>

Makes up the header of the table – http://take.ms/RjqAs

Lines 93 – 98 make up the body – http://take.ms/oPK9Q

<tr class="espresso-table-row cat-<?php echo $event->category_id; ?>">
	<td id="event_title-<?php echo $event->id?>" class="event_title"><?php echo stripslashes_deep($event->event_name) ?></td>
	<td id="venue_title-<?php echo $event->id?>" class="venue_title"><?php echo $event->venue_name ?></td>
	<td id="start_date-<?php echo $event->id?>" class="start_date"><?php echo event_date_display($event->start_date/*.' '.$event->start_time, get_option('date_format').' '.get_option('time_format')*/) ?></td>
	<td class="td-group reg-col" nowrap="nowrap"><?php echo $event_status == 'ACTIVE' ? $live_button .  $cart_link : $live_button; ?></td>
</tr>

So to remove full columns (in this example Venue), you remove the header from the table, and its matching body. So to remove Venue info from the table, remove:

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

From the header and

<td id="venue_title-<?php echo $event->id?>" class="venue_title"><?php echo $event->venue_name ?></td>

from the body.

The order they are listed within the code is the order they are within the table, Event, Venue, Date, blank for header. Then matching for body.

So just move the columns within the header and matching column within the body to change the order.

Does that make sense?


mnbookarts

May 2, 2014 at 12:51 pm

Hi Tony — the directions make sense, but I can’t find an “events-table” directory — we are on EE3, might that be something specific to EE4? Otherwise, should that be somewhere in plugins/event-espresso?


Dean

May 5, 2014 at 1:43 am

Hi,

The events-table directory should be located in:

wp-content/plugins/espresso-custom-templates/templates/events-table/


mnbookarts

May 7, 2014 at 7:19 pm

Thanks Dean, thanks Tony. I must not have uploaded that directory to the right place (or at all). It is in place now, I have made the edits Tony suggested and it is working great so far.

1) hide a column — done!
2) rearrange column order — done!

That leaves:

3) add a column, to display events’ category inline
I was able to add a “Category” column header by copying the other header, easy, but haven’t stumbled upon the right content for the body. Took a couple of stabs at it, following the lead of the other column — they didn’t work, but at least nothing exploded…
<td id="cat-<?php echo do_shortcode('[CATEGORY_NAME]');?>" class="start_date"></td>
<td id="<?php echo do_shortcode('[CATEGORY_NAME]');?>" class="start_date"></td>
<td id="<?php echo do_shortcode('[CATEGORY_NAME event_id="'.$event_id.'"]');?>" class="start_date"></td>
(I’m using the “start_date” class just to keep the type styling consistent across all columns.)

Pointers on the correct code to pull the appropriate category names into this column?

4) adding events with no registration button
Tony asked previously: “Do you want the events to only be visible within that table or would you like users to click to view more info anf view the event description?” Ideally, we would like a link to view more info. I could either add info on the resulting EE event page, or (more likely) make that page redirect to our existing post about that event, so I’m not duplicating content across multiple pages.

One other problem, with the “Filter by category” dropdown menu — I’m noticing something weird with events that are tagged with multiple categories. When I select a category, events with that category tag are displayed, EXCEPT for events that are tagged with multiple categories. For instance, one event is tagged with both “Adult Classes” and “Visiting Artist Workshops”. When I select “Show All” on the dropdown, it is included in the list. When I select “Adult Classes”, it is not listed. When I select “Visiting Artist Workshops”, it is not listed. (In fact, nothing is, because all “Visiting Artist Workshops” are also tagged as “Adult Classes”.) Is this a known problem? It doesn’t appear to be a hierarchy issue because (I would assume) then we would see it listed under one but not both; instead, they actually are not listed under either.

Thanks a million for your help and insights!


Tony

  • Support Staff

May 8, 2014 at 4:32 am

Hi mnbookarts,

3) add a column, to display events’ category inline

This one is the closest –

do_shortcode('[CATEGORY_NAME event_id="'.$event_id.'"]')

Although within that loop there is no variable $event_id which is why that doesn’t work. You’ll need to use $event->id so something like:

<?php echo do_shortcode('[CATEGORY_NAME event_id=' . $event->id .']');?>

Also, if you are going to use that multiple times within the document (it would appear not but just incase) I would recommend placing the output from that within a variable and using the variable when needed. So for example:

$category_name = do_shortcode('[CATEGORY_NAME event_id=' . $event->id .']');

$echo category_name;

4) adding events with no registration button

The easiest way to do this is to just add the event post url to the ‘Alternative Registration Page’ field within the event (http://take.ms/zB7dZ) the Register now text will change to display ‘View Details’ (http://take.ms/42Ti9). In the example I have posted, clicking that link will take you to the sites thank-you page but you just need to set your Event Post there. Be sure to include the full URL in that field.

One other problem, with the “Filter by category” dropdown menu…

We have seen this previous and have a fix. As you’ve moved things around within the template my line numbers will not match, but around line 100 you’ll find:

<tr class="espresso-table-row cat-<?php echo $event->category_id; ?>">

Change that to:

<tr class="espresso-table-row cat-<?php echo str_replace(',', ' cat-', $event->category_id); ?>">

Also further below within the Javascript/jQuery section you’ll find this line:

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

change that to:

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

Does that help?


mnbookarts

May 12, 2014 at 1:37 pm

Everything is working perfectly! Thank you so much Tony!


mnbookarts

May 12, 2014 at 1:43 pm

Now that all the functions are running smoothly, I can get REALLY fussy — categories are displaying in a column correctly, and events with multiple categories are showing correctly, is there a way to style the display of multiple categories? i.e. an event with two category tags says (in the Category column) “Visiting Artists Adult Classes” or “Artist Meet-ups Adult Classes”. Is there a way to force those categories apart rather than just a continuous string? Interjecting a line break or semicolon between, for instance? If it’s a hassle to manipulate that, we can definitely live with it as is.
Thanks a million!


Tony

  • Support Staff

May 13, 2014 at 2:50 am

Hi mnbookarts,

Unfortunately that’s not as simple as the above.

The [CATEGORY_NAME] shortcode, used to pull the categorie names within that template uses a core function within Event Espresso, modifying that is not something we can recommend as it will have implications in other areas of the plugin.


mnbookarts

May 13, 2014 at 11:29 am

Got it, not a problem. Thanks again for all your help, we are very happy with the result!


Tony

  • Support Staff

May 13, 2014 at 11:44 am

No Problem,

I’m glad you are happy with the output 🙂

I’ll mark this thread resolved.

Viewing 12 reply threads

The support post ‘Customizations to Event List’ 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