Home › Forums › Calendar Products › Events Calendar PRO › list by date and venue
- This topic has 4 replies, 3 voices, and was last updated 9 years, 9 months ago by
Cliff.
-
AuthorPosts
-
July 20, 2016 at 8:54 am #1141925
divcom_uk
ParticipantHi Folks- before i pile in with the custom templating i’m wondering if there’s an easy way to achieve the following.
Use case- we run large trade shows, which often have a number of ‘theaters’ (Venues) with numerous events over two, or three days. Because there’s often a lot of events and we often sell individual day tickets, it’s useful for people to be able to see what’s on for each day of the show on a per-venue basisI know it’s possible to display a day view of all events eg ‘yoursite.com/events/2016-09-25 ‘
I’m wondering if there’s an equivalent url query string i can use to show a single day view for a particular venue? tried adding the date string to the venue url, and also tried variations of ‘yoursite.com/venue/venue-name/?tribe-bar-date=2016-09-25‘ with no joy.Many Thanks,
PeteJuly 21, 2016 at 8:41 am #1142428Cliff
MemberHi Pete.
From our Demo Site, here’s an example page of a single Venue: http://wpshindig.com/venue/transformabcn/
In theory, I imagine you could custom code what you want in one of two ways:
1) Reference our Themer’s Guide to replace the /wp-content/plugins/events-calendar-pro/src/views/pro/single-venue.php file with your own [child-theme-directory]/tribe-events/pro/single-venue.php file and then include some custom code to display your own span of events based on your own query string parameters
2) Create your own custom shortcode to use wherever you want, such as a WordPress Page.
===
You could also decide if you want to suggest this as a feature request at our plugins’ UserVoice page.
Please do add your feature request there.
This allows others who are interested in that feature to easily voice their support. We frequently review suggestions there to find out which ones are popular, then we implement as many of them as we can.
If you post it, feel free to link to it from here in case anyone comes across this forum thread in the future.
===
I hope this helps!
July 21, 2016 at 8:58 am #1142439divcom_uk
ParticipantHi Cliff- of course i could use categories!
obviously, having overlooked the simple option, i’ve ended up with a fairly interesting solution involving the Advanced Custom Fields Pro plugin, and about a day’s worth of tinkering.
I set up a field group with 2 date/time pickers for start_date and end_date, and a post object id field which pulled the ID of the available venues.
I then built a page template which as well as the page content, displayed the venue information at the top, and showed a list of events in the range specified by the start and end dates with a tribe_get_events loop that used the output from those fields as values for the start date, end date and venue optionsadded here for posterity:
function to return the ACF fields as usable data:<?php $theatre = get_field('theatre'); $day1start = get_field('start_time1'); $day1end = get_field('end_time1'); $day1nice = get_field('start_time1', false, false); $nicedate1 = new DateTime($day1nice); ?>Function to show the venu information:
<?php $args = array('p' => $theatre, 'post_type' => 'tribe_venue'); $loop = new WP_Query($args); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php if ( has_post_thumbnail() ): ?> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium' , array('class'=>'aligncenter'));?></a> <?php endif;?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_content (); ?> <?php endwhile; ?>Function to query the posts and display the looped data with the date as a prominent title using styles already in the theme:
<h3><?php echo $nicedate1->format('l, M j'); ?></h3> <ul> <?php global $post; $events_query = tribe_get_events( array( 'start_date' => $day1start, 'end_date' => $day1end , 'venue'=> $theatre )); foreach($events_query as $post) { setup_postdata($post); ?> <li> <?php if ( has_post_thumbnail() ): ?> <div class="speakerpic"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail(); ?> </a> </div> <?php endif;?> <h3><i class="fa fa-clock-o"></i> <?php echo tribe_get_start_date($post->ID, true, 'g:i a'); ?> - <?php echo tribe_get_end_date($post->ID, true, 'g:i a'); ?><br></h3> <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> <h6> <i class="fa fa-user"></i> Speaking: <span class="speaking"><?php //extra info $organizer = tribe_get_organizer(); $organizer_ids = tribe_get_organizer_ids(); $multiple = count( $organizer_ids ) > 1; foreach ( $organizer_ids as $organizer ) { if ( ! $organizer ) { continue; } ?> <?php echo tribe_get_organizer_link( $organizer )?> <?php } if ( ! $multiple ) { // only show organizer details if there is one }//end if ?></span><br> <?php $zone = tribe_get_custom_field('Zone'); if (!empty($zone)) { ?> <i class="fa fa-map-signs"></i> Zone: <?php echo tribe_get_custom_field('Zone');?><br> <?php } else {} ?></h6> </li> <?php } //endforeach ?> <?php wp_reset_query(); ?> </ul>definitely using a hammer to crack an egg here. Thanks for the help though – maybe this will come in useful to someone one day! i’ll add the feature to the user voices as well – cracking support as usual!
Thanks,
PeteJuly 21, 2016 at 9:32 am #1142459Cliff
MemberThanks for sharing, Pete!
Have a great rest of your week.
-
AuthorPosts
- The topic ‘list by date and venue’ is closed to new replies.
