Streaming live at 10am (PST)

MixItUp Filter on Load

I’ve been using the MixItUp tutorial from @sabanna and they have been working great. But I want to make it load a specific filter when a page loads and can’t find any help online other than the guides from the Kunka Labs page:

https://www.kunkalabs.com/tutorials/filtering-and-sorting-on-load/

I am running into a wall and can’t figure out how to make the stuff provided from Kunka to work in Webflow.

Any help would be great!

Hello, @mkup!

What exactly you can’t understand in the Kunka Labs tutorial?

Basically that I add the code in the body section (below) with the specific filter I want to load up placed in place of ‘category-2’ but it still is loading up as ‘all’ by default. Is there something else I am missing to adjust?

var mixer = mixitup(containerEl, {
load: {
filter: ‘.category-2’
}
});

Hey, @mkup!

You don’t need to use all these lines, it creates another “mixer” call, this is why it doesn’t work.

All you need to do is add these lines inside the existing one

 {
    load: {
        filter: '.category-2'
    }
}

1 Like

@sabanna - Has anyone told you that you’re a lifesaver??

Thanks so much for the help!

1 Like

Glad I could help :slightly_smiling_face: and thanks for being patient with all these tutorials

1 Like

Hi @sabanna

I hope you can help me :slight_smile:

My page loads correctly but the MixItUp multifilter doesn’t work as it should when I use the other filters after load. I have tried using the following without luck (line 168+169) from this tutorial https://github.com/patrickkunka/mixitup/issues/364:

mixer.setFilterGroupSelectors(‘kategori’, ‘.kok’);
mixer.setFilterGroupSelectors(‘region’, ‘.københavn’);

You can view my project here: https://preview.webflow.com/preview/restaurantjob?utm_medium=preview_link&utm_source=designer&utm_content=restaurantjob&preview=0aff5884355a070abf43221782b4252f&pageId=5d63da38afd53f43511e3769&itemId=5d63dfcdf5f139fd8ff3e0f8&mode=preview

Hello, @CasperKp!

The console error on the published site indicates that you are tryingto filter by category that doesn’t exist
08%20AM

You might want to revisit this settings
CloudApp

If kategori and region should be variables, then they should be declared earlier and added without quotes.