Filter bar – having dropdown for the search

Home Forums Calendar Products Events Calendar PRO Filter bar – having dropdown for the search

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #949602
    stephenmiles
    Participant

    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

    #949827
    Gustavo Bordoni
    Keymaster

    Hi 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,

    #950506
    stephenmiles
    Participant

    Thank 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

    #950649
    Gustavo Bordoni
    Keymaster

    Hi 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,

    #951090
    stephenmiles
    Participant

    Thank 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

    #951091
    Gustavo Bordoni
    Keymaster

    Hi 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,

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Filter bar – having dropdown for the search’ is closed to new replies.