Venue dropdown search using wildcard

Home Forums Calendar Products Events Calendar PRO Venue dropdown search using wildcard

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1219509
    Eric
    Participant

    Hi,

    I’m having the following problem, the search for the venue is not wildcard, is it possible to change that?

    See also https://screencast.com/t/RcSoZ1k3poj

    Eric

    #1219962
    Brook
    Participant

    Howdy again Eric,

    I would love to help you find a solution for this, as best I can.

    This is likely possible to do. The jQuery  plugin which powers that dropdown/search is called Select2. As of Select2 version 4.0 the search function can be modified. Here is an example modification that likely works exactly like you want. The problem is that we are using Select2 version 3.5.

    You or your PHP developer could dequeue our version of Select2 and enqueue a newer version of it, such as 4.0. From there following this example you could swap out the “matcher” algorithm for one of your own, likely you would be happy just copying the one from that example.

    Does that make sense?

    Cheers!

    – Brook

    #1223446
    Eric
    Participant

    Hi Brook,

    Thanks for the reply, but I still have a question.

    Why is it that if I have the following options in the venue dropdown:

    Option A
    Option B

    And I search for ‘on A’ I don’t get this match

    Option A
    Option B

    But I have to search for ‘Option A’

    —-
    For your solution, where is the hook that I can dequeue the Select2 version of tribe events. And where can I find the init for the venue dropdown (i.e. which js file)

    Eric

    • This reply was modified 9 years, 2 months ago by Eric.
    • This reply was modified 9 years, 2 months ago by Eric.
    #1224188
    Brook
    Participant

    Howdy again Eric!

    Why is it that if I have the following options in the venue dropdown:

    Option A
    Option B

    And I search for ‘on A’ I don’t get this match

    Simply put: because the third party library our plugin uses, Select 2, does not work that way. By default it searches from the beginning of the full string.

    For your solution, where is the hook that I can dequeue the Select2 version of tribe events. And where can I find the init for the venue dropdown (i.e. which js file)

    You could use any of the hooks people commonly use for dequeueing. For example, ‘wp_print_scripts’ is a well-timed action for this sort of thing. The script handle you want to dequeue and possible deregister is ‘tribe-select2’. From there you can create your own.

    Cheers!

    – Brook

    #1238768
    Support Droid
    Keymaster

    Hey 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Venue dropdown search using wildcard’ is closed to new replies.