Support

Home Forums Event Espresso Premium Venue_Events Shortcode Modification

Venue_Events Shortcode Modification

Posted: November 15, 2013 at 1:05 pm

Viewing 4 reply threads


marketing

November 15, 2013 at 1:05 pm

I’m wondering why this shortcode:

do_shortcode('[ESPRESSO_VENUE_EVENTS id=' . $venue_id .']');

Returns closed events? Shouldn’t it just return active and upcoming events? It doesn’t display the data of course, but you can see if generates html like other active upcoming events. Example:

With no events at all:
<pre class=”brush: html; gutter: true; first-line: 1; highlight: []; html-script: false”><div id="event_wrapper">
<div id="event_search_code" style="display:none;" data="id=3&venue_id=3&use_venue_id=1&category_identifier=&event_category_id=&staff_id=&allow_override=0&show_expired=false&show_secondary=false&show_deleted=false&show_recurrence=true&limit=0&order_by=NULL&sort=&css_class=NULL&events_per_page=50&num_page_links_to_display=10"></div>
<div id="event_container_pagination">
<div id="event_content" class="event_content">No Information Sessions available…</div>
</div>
</div>

With no Upcoming Events (I think this should give the same output as above, but this is what you get):
<pre class=”brush: html; gutter: true; first-line: 1; highlight: []; html-script: false”><div id="event_wrapper">
<div id="event_search_code" style="display:none;" data="id=1&venue_id=1&use_venue_id=1&category_identifier=&event_category_id=&staff_id=&allow_override=0&show_expired=false&show_secondary=false&show_deleted=false&show_recurrence=true&limit=0&order_by=NULL&sort=&css_class=NULL&events_per_page=50&num_page_links_to_display=10"></div>
<div id="event_container_pagination">
<div id="event_content" class="event_content">
<p id="events_category_name-12" class="events_category_name"></p>
</div>
</div>
</div>

Hope this makes sense and is helpful.

  • This topic was modified 11 years ago by marketing.
  • This topic was modified 11 years ago by marketing.


Josh

  • Support Staff

November 15, 2013 at 1:53 pm

I’m not sure, what is it that you are trying to do?


marketing

November 18, 2013 at 2:27 pm

We’ve built out a custom page that uses ajax to call the short-code based on an event ID. We need it to display only events which are within active REGISTRATION start and end dates. Otherwise it should display a “No Information Sessions available…”. Right now the logic for the short-code seems to bring in all events matching the id, then shows or hides them according to status. I would like to just bring in the events matching a status rather than filter through the event object and account of the conditions where I need to show or hide even information.

Maybe the short-code can have a parameter for event status?


Dean

November 19, 2013 at 4:58 am

Hi Deborah,

The ESPRESSO_VENUE_EVENTS shortcode should not return expired events by default. It uses a function that has the expired events parameter set as false (event_espresso_get_event_details in event_list.php).

If the way the shortcode handles things isn’t suitable for your needs, I would suggest a direct SQL query to grab the data you need.


marketing

November 26, 2013 at 5:54 pm

Hi Dean,

I may just do that, this all mainly revolves around getting the “no events at this location” message to show when no OPEN events are in the system. Right now it only shows when there are no events for the location at all. I think I can pull off some code to make this happen though. Thanks!

Viewing 4 reply threads

The support post ‘Venue_Events Shortcode Modification’ 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