Special Category Page With Event List

Home Forums Ticket Products Event Tickets Plus Special Category Page With Event List

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1085152
    Vivianne
    Participant

    I need to create a category-page with an event list showing only the events of this category and some more content which differs from category to category. It would be great to do this in the editor.
    I would need a template with the event-list-category-code in it but for my themes-folder, so I could choose it for this specific pages.
    Is there a possibility to do this?

    I also moved the booking form (from event tickets plus) into my events list – I also need this on the category page.

    #1085171
    Vivianne
    Participant

    I already did this:

    <!-- Upcoming event list -->
     <?php do_action( 'tribe_events_single_venue_before_upcoming_events' ) ?>
     <?php
     global $post;
     ?>
     <?php do_action( 'tribe_events_inside_before_loop' ); ?>
     <!-- Month / Year Headers -->
     <?php tribe_events_list_the_date_headers(); ?>
     <!-- Event  -->
     <?php
       $post_parent = '';
       if ( $post->post_parent ) {
         $post_parent = ' data-parent-post-id="' . absint( $post->post_parent ) . '"';
       }
     ?>
     <div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?>" <?php echo $post_parent; ?>>
       <?php tribe_get_template_part( 'list/single', 'event' ) ?>
     </div>
    
     <?php do_action( 'tribe_events_inside_after_loop' ); ?>
    
     <?php do_action( 'tribe_events_single_venue_after_upcoming_events' ) ?>

    It shows a list, but not the Booking form which I integrated in the list (and which works very well on the complete eventlist). How can I integrate the booking form here? The list is also not showing the venue name and adress (which also works perfectly in the complete event list.)

    I integrated the booking form in the list with this code in my theme´s functions.php:

    if( class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) {
    			remove_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(), 			'front_end_tickets_form', 5) );
    		
    			add_action( 'tribe_events_single_event_before_the_content', array( Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(), 			'front_end_tickets_form') );
    		
    			add_action( 'tribe_events_after_the_content', array( Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(), 'front_end_tickets_form') );
    		}
    

    I hope you can follow me. 😉

    #1086147
    Geoff B.
    Member

    Good evening Vivianne and welcome back!

    Thank you for reaching out to us.
    I would love to try to help you with this topic.

    As you might know, the scope of our support is mostly to get our wonderful customers started on the right track to customize their site and to help them in case of issues. We unfortunately do not provide complete support for customization.

    If you need anything above my suggestions, you might consider hiring one of our recommended customizers to do the customization for you.

    That being said, if you want to replicate the same customization you have already put in place (integrating the tickets_plus form to the list), have you considered simply using the do_shortcode approach (since you are using the Events Calendar Pro)?

    This might sound overly simplistic, but it would trigger your customizations.

    If you haven’t read it already, here’s the list of shortcodes: https://theeventscalendar.com/knowledgebase/pro-widget-shortcodes/

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1086577
    Vivianne
    Participant

    Yes, I want exactly the same list format on the category page as on the other sites.
    What do you mean exactly with “do_shortcode approach”?
    I found the shortcodes but if I use them, they don´t show my special list format which I created in my single-event.php. And I really need this format because it also holds custom fields.

    #1086994
    Geoff B.
    Member

    Hello again Vivianne,

    Perfect.

    What I mean is using the built-in do_shortcode feature of WordPress as described here: https://developer.wordpress.org/reference/functions/do_shortcode/

    Simply put, you can call shortcodes in a template and feed some of it’s variable using custom fields.

    Let me know how that goes.

    Best regards,
    Geoff B.

    #1087142
    Vivianne
    Participant

    Thanks for your further explanation.
    I can not solve it with the shortcodes. The code I posted already makes almost everything I need.
    Just need the booking form in it. Is there something I need to add to the code in the functions.php in my theme (see the code above)?

    #1087254
    Vivianne
    Participant

    I found something which seems to be easier to find a solution.
    This code in my theme´s template produces the perfect list with every element I need and also with the booking form.

    		<?php echo tribe_include_view_list( array(
    			'eventDisplay'=>'upcoming',
    	        'posts_per_page'=>10
    		) )?>

    But:
    If I add this line 'tribe_events_cat' => 23, it breaks and shows no event.
    Without this line it shows all the events in every category.
    How can I only show the events from one category?

    #1087385
    Geoff B.
    Member

    Hi again Vivianne,

    I’m sorry you could not get the do_shortcode approach to work for you, it would have been the perfect solution.

    As you know, I’m pretty much limited to getting you started on the right path for customizations. 🙂

    So if you are going to pursue the latest snippet you shared with me, I would advise taking a look at how category filtering is handled in the following files from the Events Calendar Pro add-on:

    • /events-calendar-pro/src/Tribe/Shortcodes/Events_List.php
    • /events-calendar-pro/src/Tribe/Advanced_List_Widget.php
    • /events-calendar-pro/src/Tribe/Shortcodes/Filtered_Shortcode.php

    Have a great day!

    Geoff B.

     

    #1088346
    Vivianne
    Participant

    Thanks Geoff!
    I solved it!

    So for other users searching for this option here is the code in my template which works perfectly:

    <?php echo tribe_include_view_list( array(
    	'tribe_events_cat' => 'addcategoryname',
    	'eventDisplay'=>'upcoming',
    	'post_type' => 'tribe_events',
    	'taxonomy' => 'tribe_events_cat'
    ) )?>
    #1088826
    Geoff B.
    Member

    Good evening Vivianne,

    This is absolutely awesome! Kudos and thanks for sharing.

    Have a great evening and you are always welcome back on our forums.

    Geoff B.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Special Category Page With Event List’ is closed to new replies.