Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Bootstrap-Select & jPlist

Hi guys!

Im using this great jQuery plugin in my WP theme to create filters and stuff: https://jplist.com/ I found this great extension for Bootstrap to create really neat and useful selects http://silviomoreto.github.io/bootstrap-select/

Now I would like to combine them, use the selects as filter with multiple select etc. I've successfully setup everything, but Im stuck on how to get them to work together! Im using this foreach loop to create the selects:

                   <select
                    class="jplist-group selectpicker"
                    data-control-type="checkbox-group-filter"
                    data-control-action="filter"
                    data-control-name="manufacturers"
                    data-live-search="true"
                    multiple title='Select manufacturers'
                    multiple
                  >

                    <?php $args = array(
                    'orderby'            => 'name',
                    'order'              => 'ASC',
                    'hide_empty'         => 1,
                    'taxonomy'           => 'manufacturers'
                    );
                    $categories = get_categories($args);
                    foreach ($categories as $cat) {
                    echo '<option>'.$cat->name.'';
                    echo '</option>';}
                    ?>
                  </select>

This outputs all the manufacturers in a select list, as you can see I enabled multiple select and live search support for the select fields.

Here you can get an impression on how the filters work on jPlist https://jplist.com/togglefiltersexamples/index However, I can't figure out how to work it out.

I hope you guys can help me out a little more, Im almost there!

Thanks!

2 Answers

Anybody who can help me out on this one?

C'mon, is there nobody who can help me out on this?