Filter by Venue – Drop down menu

Home Forums Calendar Products Filter Bar Filter by Venue – Drop down menu

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #751527
    DON KRONTZ
    Participant

    I like having a drop down menu instead of the checkbox option for filtering by venue.

    I have attempted to use some of the code from the category filter which can be viewed as drop down, but this is not functioning correctly. After changing the $type to checkbox, i pasted into the TribeEventsFilter_Venue.php file below

    public $type = ‘checkbox’;

    public function get_admin_form() {
    $title = $this->get_title_field();
    $type = $this->get_type_field();
    return $title.$type;
    }

    protected function get_type_field() {
    $name = $this->get_admin_field_name(‘type’);
    $field = sprintf( __( ‘Type: %s %s’, ‘tribe-events-calendar-pro’ ),
    sprintf( ‘<label><input type=”radio” name=”%s” value=”select” %s /> %s</label>’,
    $name,
    checked( $this->type, ‘select’, false ),
    __( ‘Dropdown’, ‘tribe-events-calendar-pro’ )
    ),
    sprintf( ‘<label><input type=”radio” name=”%s” value=”radio” %s /> %s</label>’,
    $name,
    checked( $this->type, ‘radio’, false ),
    __( ‘Radio Buttons’, ‘tribe-events-calendar-pro’ )
    )
    );
    return ‘<div class=”tribe_events_active_filter_type_options”>’.$field.'</div>’;
    }

    While i can see the drop down menu after inserting this code, it does not process the filter. Any suggestions?

    #752992
    Josh
    Participant

    Hello dejavudotcom,

    Thanks for reaching out to us!

    Usually, it’s not a good idea to modify plugin files directly since the functionality will be lost when updating. However, if you change the public $type parameter within the TribeEventsFilter_Venue.php to “select”, you should get the dropdown functionality for the venue filter.

    Let me know if this helps.

    Thanks!

    #759902
    DON KRONTZ
    Participant

    Hi Josh,

    After reading my original post, i accidentally wrote checkbox instead of select. So again I tried that, simply changing the public $type to ‘select’ and leaving the rest of the TribeEventsFilter_Venue.php as is. While that changes the front end correctly, the filter seems to get stuck in a loop as it looks like it is going to load but never does.

    #761452
    Josh
    Participant

    Hello dejavudotcom,

    Thanks for following up with us!

    I just noticed that your stated plugin version is pretty old. Also, the code pasted in your initial post for “TribeEventsFilter_Venue.php” is different than what is in the latest version of the plugin. This is probably what is causing the load issue that you’re currently seeing on the site. If you’re able to, you can update to the latest version of the plugin and this should allow it to work as expected.

    Let me know if this helps.

    Thanks!

    #761915
    DON KRONTZ
    Participant

    I just downloaded the plugin recently… version 3.7. I don’t see any more current downloads available.

    The code in the original post i grabbed from the TribeEventsFilter_Category.php, as i thought that was connected with the public $type = ‘select’ function which that filter has available. I’ve returned to the original code from the TribeEventsFilter_Venue.php, only changing the public $type from ‘checkbox’ to ‘select’ as you suggested. This is where i resolved yesterday, and it does not process the filter. Visually it appears as drop down, but when an item select i get spinning wheel like its trying to process but does not.

    #763721
    Josh
    Participant

    Hello dejavudotcom,

    Thanks for following up with us!

    Sorry for the confusion on the version numbers. Looks like we’re both looking at the same file now :).

    On closer inspection, I noticed that although the filter provides a result, the results I was getting weren’t accurate. It looks like this is possibly due to the query expecting an array which isn’t output when the “select” type is used. Consequently, implementing a select option for that field will be a little more complicated than I initially suspected.

    You could potentially use the TribeEventsFilter_Category.php along with the tribe-filter.class.php to figure out the best way to implement the select for the venue filter. You could also suggest this as a feature for our developers to consider for a future release on our UserVoice page.

    I’m sorry I wasn’t able to give you a direct response however I hope this was able to point you in the right direction.

    Thanks!

    #958955
    Josh
    Participant

    Hey,

    It’s been a while since we’ve heard from you on this thread.

    I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.

    Thanks!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Filter by Venue – Drop down menu’ is closed to new replies.