Home › Forums › Ticket Products › Event Tickets Plus › Special Category Page With Event List
- This topic has 9 replies, 2 voices, and was last updated 10 years, 1 month ago by
Geoff B..
-
AuthorPosts
-
March 4, 2016 at 12:54 am #1085152
Vivianne
ParticipantI 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.
March 4, 2016 at 3:59 am #1085171Vivianne
ParticipantI 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. 😉
March 7, 2016 at 8:52 pm #1086147Geoff B.
MemberGood 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.
March 9, 2016 at 3:26 am #1086577Vivianne
ParticipantYes, 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.March 9, 2016 at 10:39 pm #1086994Geoff B.
MemberHello 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.March 10, 2016 at 7:11 am #1087142Vivianne
ParticipantThanks 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)?March 10, 2016 at 8:46 am #1087254Vivianne
ParticipantI 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?March 10, 2016 at 12:58 pm #1087385Geoff B.
MemberHi 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.
March 14, 2016 at 2:11 am #1088346Vivianne
ParticipantThanks 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' ) )?>March 14, 2016 at 3:41 pm #1088826Geoff B.
MemberGood 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.
-
AuthorPosts
- The topic ‘Special Category Page With Event List’ is closed to new replies.
