Support

Home Forums Event Espresso Premium Clickable links on events table

Clickable links on events table

Posted: October 9, 2019 at 2:42 am


Porter

October 9, 2019 at 2:42 am

I have followed the steps in the following forum

https://eventespresso.com/topic/clickable-links-on-events-table/

but I have been unable to get the venue links in the event table working.


Porter

October 9, 2019 at 2:44 am

This reply has been marked as private.


Tony

  • Support Staff

October 9, 2019 at 5:03 am

Ok, so you’ve copied espresso-events-table-template.template.php to the root directory of your theme, correct?

It looks like you’ve already added the code to make the event name a link so have you changed this code:

espresso_venue_name( NULL, FALSE );

to be:

espresso_venue_name( NULL);

The FALSE in that function call tells the function not to return a link, removing uses the default setting (which is to return a link to the venue details).

The code you’re looking for should be around line 114-116 and looks like this:

<?php if( $show_venues ) { ?>
	<td class="venue_title event-<?php echo $post->ID; ?>"><?php espresso_venue_name( NULL, FALSE ); ?></td>
<?php } ?>


Porter

October 9, 2019 at 5:16 am

This reply has been marked as private.


Tony

  • Support Staff

October 9, 2019 at 5:51 am

I think the problem is that the code has already been changed as we wanted the venue city to be pulled into the table and not the venue name.

Yeah, that’s likely why.

Do you need to see more of the code?

Yes, you’ll need to post the full template to something like PasteBin so I can take a look.


Porter

October 9, 2019 at 8:19 am

This reply has been marked as private.


Josh

  • Support Staff

October 9, 2019 at 8:56 am

Hi,

The pastebin link you shared is private, so we cannot see the code.


Porter

October 9, 2019 at 9:01 am

Please can you try again – i’ve made it public


Josh

  • Support Staff

October 9, 2019 at 9:04 am

Hi,

I looked, and the code in the template you posted doesn’t match what you posted in the above comment.

If the code in the pastebin is actually what you are using, then you’ll change line 115 from:
<td class="venue_title event-<?php echo $post->ID; ?>"><?php espresso_venue_name( NULL, FALSE ); ?></td>
to
<td class="venue_title event-<?php echo $post->ID; ?>"><?php espresso_venue_name( NULL ); ?></td>


Porter

October 9, 2019 at 12:27 pm

Apologies – here is the correct link https://pastebin.com/M2M6Ewgi


Josh

  • Support Staff

October 9, 2019 at 12:51 pm

OK that makes a little more sense now.

Where you have this:

if ($venue instanceof EE_Venue) {
     $venue_city = $venue->city();
}

You can get the venue URL too, e.g.

if ($venue instanceof EE_Venue) {
     $venue_city = $venue->city();
     $venue_url  = get_permalink($venue->ID());
}

Then, where you’re displaying the venue city on line 186:
<?php echo $venue_city; ?>
you can change to:
<?php echo '<a href="'.$venue_url.'">'.$venue_city.'</a>'; ?>


Porter

October 9, 2019 at 4:17 pm

Thank you – that’s worked 🙂

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  Porter 1 week ago ago

Topic Tags

Notifications

This topic is: resolved
Do NOT follow this link or you will be banned from the site!