Reoccurring events: Jump into a specific event

WordPress Event Management, Calendars & Registration Forums General Question Reoccurring events: Jump into a specific event

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 10 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7914

    Shortcode [eo_events] prints out a list of events. When clicking on one of them the expected behavior would be to jump to the detail page of this event and having the booking form selected with the event that has been clicked.

    Now I’m using a reoccurring/multievents (not sure how it’s called in English) – when I pick out one of them from the [eo_events] list the click leads me to an overview of all recurrences of this events and no event is selected in the booking form. This is confusing.

    Is there a way to jump into a specific event and select the chosen one in the detail page?

    Adrian Maleska
    #7916

    Hi Adrian,

    Unforunately there isn’t – its a predominantly technical reason why this is difficult to do, which stems from a decision made early on in Event Organiser’s development. The event’s page isn’t tied to any particular occurrence. The reasons for this are:

    • Improved performance – for most the content of the page is identical, so its a waste to bloat the database with additional rows of identical data.
    • Perhaps, more importantly, these duplicated pages can harm SEO (I’m not a “SEO-expert” (whatever that might mean), and since Google’s algorithm for ranking pages is kept secret, I do not not how much impact it would have, if at all).
    • Most people expresssed a preference for a singe page, for recurring events.

    That said, I realise it might be helpflul/intuitive to show the date the user clicked, unfortuantely there is a technical reason why the plug-in can’t implement this itself. The function get_permalink() filters the url of the page, but only references the (post) ID – which is common to allocurrences of a given event. In short you’re ‘blind’ as to what occurrence you’re referring to that.

    That said, if you are editing the templates you can do something like the following (assuming $post is the event object):

     $url = add_query_arg( 'oid', $post->occurrence_id, get_permalink( $post->ID ) );

    which appends the ?oid=[occurrence ID] to the event url. Then on the event page template you can retrieve this:

    $occurrence_id = !empty( $_GET['oid'] ) ? intval( $_GET['oid'] ) : 0;

    (and then use it with the API such as: eo_get_the_start() (see codex). But keep in mind that $_GET['oid'] might not return anything. That is they may have landed on the page without clicking any date in particular.

    In this way you can add occurrence-specific links to shortcodes/widgets by editing the templates.

    Stephen Harris
    #8039

    Oh, I allready posted a comment but somehow it got lost … Ok, then over again.
    Thank you very much Stephen for this great support. You’re indeed very helpful. The general idea with giving the link a uid is quite good. But the event can be displayed by widgets too – this is where I guess have no control over the link building. On other places it’s working fine. Instead of the post id or even permalink I’m using a uid build from the date and postcode of the venue which can be easy generated inside the shortcode like this:

     %event_title%  

    Inside event-meta-event-single.php it goes like this:

    // inside of the date display (excrept)
    if( $upcoming->have_posts() ): ?>
      
  • <?php echo "Veranstaltungen";//_e('Upcoming Dates','eventorganiser'); ?>: <ul id="eo-upcoming-dates"> <?php while( $upcoming->have_posts() ): $upcoming->the_post(); $venue_adress = eo_get_venue_address(eo_get_venue_slug()); $venue_postcode = $venue_adress['postcode']; $event_uid = eo_get_the_start('Ymd').$venue_postcode; if($uri_uid == $event_uid) $output_highlight = "class='highlight';"; else $output_highlight = ""; $output_startdate = eo_get_the_start($date_format); echo "
  • {$output_startdate}
  • "; ?> <?php endwhile; ?>
    Adrian Maleska
    #8042

    Hi Adrian,

    The widgets all have templates too, so you can copy them into your theme and edit them to include the occurrence ID in the event links. The exception to this is the widget calendar and agenda widget. There is a filter the widget calendar links (which by default links to an event listing page, rather than individual events): http://wp-event-organiser.com/documentation/hook/eventorganiser_widget_calendar_date_link/.

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.