Google Link when no venue

This topic contains 2 replies, has 2 voices, and was last updated by  dcb 11 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5514

    Hi Stephen,
    I have modified event-meta-event-single.php to add a link to google. It works great except if no venue is specified, or a venue is specified without any location information. The page does not build and I do not get errors reported even with debug on.

    For a single event, I can replicate this by copying event-meta-event-single.php (running EO v 2.0) to my theme and adding the 2 lines below that reference $addotcalurl in the block at line 56:

    <?php if( !eo_reoccurs() ){ ?>
    <!-- Single event -->
    <?php $addtocalurl = eo_get_the_GoogleLink(); ?>
    <li> <?php echo $addtocalurl; ?> </li>
    <li><strong><?php _e('Start', 'eventorganiser') ;?>:</strong> <?php eo_the_start($date_format); ?> </li>
    <?php
    } ?>

    This writes the correct URL on the page when location data exists, but when there is “No Venue” or the Venue doesn’t have any data filled in then the header of the page is the only part built.

    dcb
    #5533

    That’s a very obscure bugs. After nearly an hour I’ve managed to hunr the thing down. The venue is probably a red herring (I got an error when the event had a venue). The real problem seems to be no event excerpt. Without out it, WordPress uses the event content which is generated from the content prepended with the event meta details (the template you’re editing). And you’ve got yourself an infinite loop 🙂

    I’ll introduce a fix, but there are two work-around:

    1. Add an event excerpt
    2. Add your own single-event.php template to your theme. This way nothing is prepended to the event content.
    Stephen Harris
    #5551

    That explains why there was no error message! We are trying to come up with a set of test events so that we can try out the styling in various scenarios (recurring, single, past, no map.,etc.). for the customer websites where we deploy the plug-in. It seems we do not have enough test cases!!

    As I can imagine some circumstances where the event title and date/time will be self explanatory and no excerpt needed, we will probably just comment the Google link until the fix is deployed. I like the use of event-meta-event-single.php rather than event-single as it is easier to integrate with a customer’s theme. My goal is to create a standard event-meta-event-single.php to use as a starting point for our customers.This version differs from the one in the plug-in by adding additional classes for responsive design, some date formatting changes and eventually, including the add to calendar link.

    Thanks for the great support!!

    dcb
Viewing 3 posts - 1 through 3 (of 3 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.