Support

Home Forums Event Espresso Premium using venue shortcode with custom view templates

using venue shortcode with custom view templates

Posted: February 4, 2014 at 11:16 am

Viewing 2 reply threads


Gabriel Solano

February 4, 2014 at 11:16 am

hi
i’m trying to just show events from venue 12 in the calendar table add-on

[ESPRESSO_VENUE_EVENTS id=”12″ template_name=”calendar-table”]
or
[EVENT_CUSTOM_VIEW template_name=”calendar-table” ESPRESSO_VENUE_EVENTS id=”12]

but it does not work? any ideas?


Josh

  • Support Staff

February 4, 2014 at 7:41 pm

Hi Gabriel,

I’m afraid that the custom templates plugin doesn’t have the built in queries that lets you display events by venue. It’s possible to add them by adding a few lines of code though. First, in the index.php file of the custom templates add-on (to clarify, not the calendar table add-on) where it has the default shortcode attributes (right after line no. 69 you add:

'venue_id'				=> NULL,
'use_venue_id'				=> false,

Then in the main query, right before the Group by ID is added to the query (line 167) you’d add:

//Venue SQL
$sql .= isset($use_venue_id) && $use_venue_id == true ? " AND v.id = '".$venue_id."' " : '';

Now you can use your new shortcode attributes like so:

[EVENT_CUSTOM_VIEW use_venue_id=true venue_id=12 template_name=calendar-table]


Gabriel Solano

February 9, 2014 at 5:29 am

Awesome worked perfectly. thank you soo much

Viewing 2 reply threads

The support post ‘using venue shortcode with custom view templates’ 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