Home › Forums › Welcome! › Pre-Sales Questions › Filter bar and custom taxonomies?
- This topic has 6 replies, 2 voices, and was last updated 6 years, 3 months ago by Support Droid.
-
AuthorPosts
-
December 1, 2017 at 12:13 pm #1396901ferrycpParticipant
Hi,
I added a custom taxonomy (composer) to my concert events (pro version). Is it possible to use this taxonomy als a filter too?
And how about custom fields, can I use them als filter options too? For example a select with different type of concerts.Thanks
December 4, 2017 at 1:44 pm #1398112AndrasKeymasterHi ferrycp,
Thanks for using our plugins and welcome to the forums!
By default custom taxonomies and custom fields don’t appear in the filter bar. You will need to do some custom development for that. Here’s our guide on how you can create custom filters for Filter Bar.
I see you have a PRO license. What you might consider is using the Additional Fields for the events instead of custom fields. Additional Fields can be set up to be used with Filter Bar. Here’s a screenshot which might help.
If you have more questions just let me know.
Cheers,
AndrasDecember 6, 2017 at 1:20 am #1399209ferrycpParticipantHi,
I tried already the custom fields and noticed that the tribe-bar-search field doesn’t look inside them.
For example I create a textarea for the concert program, but the free search field searches only in the description and the titel.
Is this something you can fix?PS. it would be very helpful to have a field with basic wysiwyg functionality.
December 6, 2017 at 2:54 pm #1399865AndrasKeymasterHello,
I guess that could be done, but it would require customization work, which is beyond the scope of the support we can provide.
I might be able to give you some direction and pointers, but you will need to do the coding yourself. To be clear, you would like it to search in the custom fields (which exists for all post types) or in the ‘Additional Fields’ that come with Events Calendar PRO?
PS. it would be very helpful to have a field with basic wysiwyg functionality.
By this do you mean having an Additional Field that would allow some formatting?
If you think that is something you would like as a feature I encourage you to visit our User Voice Page and either upvote an existing request or make a new request there.
Andras
December 6, 2017 at 10:56 pm #1400041ferrycpParticipantHi Andras,
because the additional fields provided by the Pro plugin doesn’t offer any formatting options, I need to search in my own custom fields. Please provide your resources/examples and I will modify the code on my own.
December 7, 2017 at 4:57 am #1400183AndrasKeymasterHi,
Maybe a generic solution like this (untested) might do the trick.
Or some custom code like in this article, might also help you get started.
Search is run by this function:
public static function pre_get_posts( $query )
in this file:
wp-content\plugins\the-events-calendar\src\Tribe\Query.php
The keyword search is specifically handled in lines 217-220:
// if a user provides a search term we want to use that in the search params if ( ! empty( $_REQUEST['tribe-bar-search'] ) ) { $query->query_vars['s'] = $_REQUEST['tribe-bar-search']; }
Then you will need to tap into ‘pre_get_posts’ so the search is done in custom fields as well.
Also this article on Customizing the Events Bar might be a good resource. Contains an example on how you can tap into ‘pre_get_posts’.
Let me know if this helps and if you have any further questions.
Cheers,
AndrasDecember 29, 2017 at 8:36 am #1414509Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Filter bar and custom taxonomies?’ is closed to new replies.