Show Events on this Location widget

Home Forums Calendar Products Events Calendar PRO Show Events on this Location widget

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1087124
    Marcel Stephan
    Participant

    Hi,

    I’ve got a page with all available locations with out events. In the PRO version I can use a widget for this, called (something like) Show Events on this Location which does exactly what I want. It shows all available events on the location. In our case we have nine locations, so I put them in three rows of three which looks quite good on the website. Here’s the page in question: http://www.theatercolleges.nl/theaters/

    But there aren’t any events planned on this location I’ve got two options. The widget has an option to hide it when there are no planned events on the location. The result of this gives a blank spot on the page, which is ok but looks a bit strange when we have more locations without events.

    The other option is that I don’t tick the option in the widget. In that case the page/widget will show the name of the location and some other details. (in our case the name, link to the location and featured image. Followed by a sentence that there a no events planned on this location. Followed by a link ‘Show all events on this location’. Which is a bit strange as there aren’t any events planned.

    So my question is: can you help me to get rid of this link in the widget when there are no events planned? Or do you have any suggestions how to solve this?

    Off course I can created a single page for every location, or I can place all widgets in the same columns so they show up underneath each-other, but in that case it’s hard to see which is which. A single line around it, or a background color per location can do the trick. Here’s a link to this page I just created, so you can see the differences: http://www.theatercolleges.nl/theatertest/

    Hope you can help me.

    #1087595
    Brook
    Participant

    Howdy Marcel,

    I would love to help you with this.

    Are you familiar with how to make theme overrides? If not first familiarize yourself with our Themer’s Guide so that the rest of these instructions will make sense.

    Now create an override for /events-calendar-pro/src/views/pro/widgets/venue-widget.php . Inside of that you will see almost at the very bottom of the file this line:

    <a href="<?php echo esc_url( tribe_get_venue_link( $venue_ID, false ) ); ?>"><?php printf( __( 'View all %1$s at this %2$s', 'tribe-events-calendar-pro' ), $events_label_plural, tribe_get_venue_label_singular() ); ?></a>

    This line is set to show up whether the venue has events or not. It you want it to only show that link when the venue has no upcoming events, move it up a couple of lines just above the:

    <?php endif; ?>

    That waa it is now inside of the if block that only shows up when there are events.

    Does that all make sense? Will that work for you? Please let me know.

    Cheers!

    – Brook

    #1087677
    Marcel Stephan
    Participant

    That makes perfect sense!

    Thanks.

    #1088932
    Brook
    Participant

    Perfect! Happy we could help.

    • Brook
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Show Events on this Location widget’ is closed to new replies.