Home › Forums › Calendar Products › Events Calendar PRO › Filter bar – having dropdown for the search
- This topic has 5 replies, 2 voices, and was last updated 9 years, 1 month ago by Gustavo Bordoni.
-
AuthorPosts
-
March 20, 2015 at 12:22 am #949602stephenmilesParticipant
I do not want users of my website of have a choice of what to search, I would like to implement a dropdown list for that. So, how would I change the search from a text box to a dropdown list of predefined values?
I know you may not be able to help with code, but files and functions would be a get help.
Thank you
Stephen
March 20, 2015 at 9:40 pm #949827Gustavo BordoniKeymasterHi Stephen,
Thanks for reaching out to us here on the support forum.
Check this code below, that how you will remove the current input for the search and replace it with another one:
https://gist.github.com/bordoni/12b1532e0582acb66d86
I hope this helps, we cannot go much further on how to solve this issue for you.
My best Regards,
March 24, 2015 at 8:26 am #950506stephenmilesParticipantThank you for your help.
I have look at the code above and tried to implement it while adjusting the $filter to the following.
$filters[‘tribe-bar-search’] = array(
‘name’ => ‘tribe-bar-search’,
‘caption’ => __( ‘Search’, ‘tribe-events-calendar’ ),
‘html’ => ‘HTML FIELD’,
‘type’ => ‘dropdown’,
‘options’ => array(‘Hip Hop Tots’, ‘Family Hip Hop’)
);I found the type and options from within tribe-field.class.php file but with the the filter bar is blank. Do I also need to include a submit button?
I am missing anything else?
Thank you
Stephen
March 24, 2015 at 5:17 pm #950649Gustavo BordoniKeymasterHi Stephen,
I’ve done a small plugin that will solve your issue, go to the given URL below and follow the instructions there:
https://github.com/bordoni/tec-forum-support/tree/plugin-949602
After you activate the plugin, don’t forget that you need to fill the options on the Administration, on Events » Settings » Display » Field: Options to Search
I hope this solves your problem.
My Best Regards,
March 26, 2015 at 6:25 am #951090stephenmilesParticipantThank you for the plugin, it works a treat.
I had to modify it as when “select a option” was chosen, it was also used in the search as the value was not set to “”.
I then expanded it to include location search and remove the date search.
Thank you again
Stephen
March 26, 2015 at 6:31 am #951091Gustavo BordoniKeymasterHi Stephen,
I’m very glad to be able to help, since the problem was solved I closed the topic and marked the correct answer.
My Best Regards,
-
AuthorPosts
- The topic ‘Filter bar – having dropdown for the search’ is closed to new replies.