Home › Forums › Calendar Products › Filter Bar › Filter by Venue – Drop down menu
- This topic has 6 replies, 2 voices, and was last updated 8 years, 11 months ago by Josh.
-
AuthorPosts
-
September 18, 2014 at 2:22 pm #751527DON KRONTZParticipant
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?
September 19, 2014 at 7:35 am #752992JoshParticipantHello 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 theTribeEventsFilter_Venue.php
to “select”, you should get the dropdown functionality for the venue filter.Let me know if this helps.
Thanks!
September 22, 2014 at 5:37 pm #759902DON KRONTZParticipantHi 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.
September 23, 2014 at 7:10 am #761452JoshParticipantHello 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!
September 23, 2014 at 9:38 am #761915DON KRONTZParticipantI 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.
September 24, 2014 at 6:32 am #763721JoshParticipantHello 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 thetribe-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!
April 28, 2015 at 8:23 am #958955JoshParticipantHey,
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!
-
AuthorPosts
- The topic ‘Filter by Venue – Drop down menu’ is closed to new replies.