[TUTORIAL] MixItUp filtering plugin with Dynamic content

Hi @sabanna ! So many thanks for Your help Anna, without You my project would worth nothing. :see_no_evil:
Now everything works fine, I can continue my work. :raised_hands:

Thanks again! You are an angel! :innocent:

2 Likes

I have installed mix it up on my site and everything works well with one exception. When I click on the navigational buttons the images start to reconfigure and then abruptly jump up.

For example if you’re in “ALL PORTRAITS” and then you click on the “MEN“ button, once the first row populates, the lower rows snap up. It also happens when you go to “WOMEN” from “ALL PORTRAITS”. However, if you go to “CHILDREN” from “MEN” it transitions smoothly, like I would expect them all to work.

Is there anyway to make the transition smoother universally?

Here’s my share link:

https://preview.webflow.com/preview/fineartportrait?utm_medium=preview_link&utm_source=designer&utm_content=fineartportrait&preview=73defcdab4e75aaeaf2263ebd095829e&pageId=5d64026b68fbe9973e344227&mode=preview

This is driving me crazy. Thanks for any advice or assistance you can provide.

1 Like

Hi, @paint.you1830!

I would try to make a duration shorter and maybe remove the scale animation. Also, did you try to use flexbox instead of grid for the container?

1 Like

Hi Sabanna,

I tried many variations with both grid and flexbox. All with that dreaded snap effect. It seems that no matter what I did I would get that snapping until I finally removed all effects in the code.

It’s pretty frustrating because I can’t control the speed of the transition, but at least it’s consistent, although too quick for my taste. That jumping came across as buggy, at least to me. I wish there was some way I could slow it down. I tried nudge but it froze in the middle. Any suggestions?

Thanks for looking.

Read only link:
https://preview.webflow.com/preview/fineartportrait?utm_medium=preview_link&utm_source=designer&utm_content=fineartportrait&preview=73defcdab4e75aaeaf2263ebd095829e&pageId=5d7938eaf035e149601981fd&mode=preview

1 Like

Hello Anna! @sabanna :wave:

I wanted to achieve the search function with multidimensional filtering. :hugs:
But somehow the searching isn’t working, only the filtering. Probably is missing something or I made a mistake somewhere. :sweat:

Would You be so kind please check the code if You will have time for a quick look? :pray:

live preview:
https://housingbudapest-283350254f6d2590fd0cd95.webflow.io/

read only link:
https://preview.webflow.com/preview/housingbudapest-283350254f6d2590fd0cd95?utm_medium=preview_link&utm_source=dashboard&utm_content=housingbudapest-283350254f6d2590fd0cd95&preview=0863370848079eac937a6a70594ff357&mode=preview

I appreciate and fully respect your time. :clap:

Gabriel

1 Like

The author of the MixitUp made the search on the multi-filter only working similar to the a filter control, it search only by category and one category at a time.

Also, it require a bit different implementation and applying separate parameter to each mix-item. :woman_shrugging:

2 Likes

Hi, @paint.you1830

  1. Animation by default doesn’t have a SPEED. It has a duration, you are setting up how milliseconds it will take to change certain property on the element.

For example, this code:

"animation": {
        "duration": 674,
        "nudge": false,
        "reverseOut": false,
        "effects": "fade translateY(-17%)"
    }

It means that in 674 milliseconds all this will happes, elements will

  • fade = change its opacity from 0to 100% (or from 100% to 0) and
  • translateY = move 17% up
  1. Using a Grid for the container is not recommended by the author of the MixitUp. Or at least he mentions that he didn’t include the support for that type of layout in the library. From my experience, any layout that is forcing to “hold the space for the item” will give such glitch.

I would recommend using Flex, instead of Grid, and make sure to set align-content to flex-start It will fix the problem with the animation “snapping”
04%20PM

1 Like

Thank You Anna for Your reply! :raised_hands:@sabanna It would be enought to filter (search) by one category. :point_up:t2:
Could You help me what parameter should I implement or any hint how to make it work? :see_no_evil: Thanks for Your time again! :pray:

1 Like

Hi @sabanna,

I was wondering if there was a way to order dynamic items randomly ?
I have an entire dynamic website working properly with category filters, like explained in your amazing tutorial, but wanted to add a randomize button like described in the mixitup sorting documentation.

<button type="button" data-sort="random">randomize</button>

does that mean I need to find a way to dynamically add a data-sort attribute to my mix div, something like so:

<div class="mix" data-number="01"</div> :thinking:



Read only link here
Would you have an advice or best practice to use ?

EDIT: or is it possible to order items based on their combo class ?

Thank you ! :slight_smile:
Anthony

1 Like

It worked!!! Thanks so much.

2 Likes

for those being anoyed to always hide the .mix div before publish, here is a quick hack :slight_smile:

just copy that css line and past it into the page setting after the <head> tag custom code.
That way, you can style your mix divs as you please in the Webflow designer, and click publish.
I’ve tried it out, it works.

/* mixitup hack đŸ„ł */
.mix{display: none;}

PS:
don’t forget to wrap the css line between its <style></style> tags

Hope that helps.

1 Like

Hello,

I did try a dynamic data-number injection via JavaScript, the console successfully logs the mix div having their respective data-number based on the index of their array but still no luck with the random ordering. When The button random is clicked, all mix div disappear :thinking:

document.addEventListener("DOMContentLoaded", event => {
  (function dynamicSorting() {
    let mixes = document.getElementsByClassName("mix");
    for (let i = 0; i < mixes.length; i++) {
      let mix = mixes[i];
      mix.setAttribute("data-number", [i]);
      // the mix divs in the DOM now do have a data-number attribute
      // but the random sorting still doesn't work 😭
      console.log(mix);
    }
  })();
});

Here is a codepen to play with
Any idea ?

1 Like

Hi, just wanted to ask if this allows you to filter with CMS content selected from a dropdown? I have a list of jobs (each with a category, type (perm/contract) and a region) - Can i use mixitup to filter the jobs in my CMS is a user selects an option in a dropdown? Can it combine selections from multiple dropdowns in its filter?

Thanks :slight_smile:

1 Like

Hey man is it something like this that you are looking for? Hemly - Hitta Bostad’

Add me on disqord if you want to chat, @k4kans

2 Likes

Hey, yeh that sort of thing - can you filter with more than one dropdown? Can you keyword search AND filter with dropdowns?

1 Like

Are there any working examples of Mixitup we can see in webflow to try and figure out how they work? I have been trying to get mine working all day and would love to see some functioning examples (that i can then try to reverse engineer!) - thanks!

1 Like

you can have a look at my recent post where I rebuilt a Webflow CMS structure inside Codepen to try out some custom code I had to write for one of my project. There is no drop down menu in my example but it shouldn’t be a problem to implement.

Hope that helps

1 Like

Hi, @DrNinjamonkey here is an example of “dropdowns” (which are actually Select inputs)
http://mixitup-multifilter-examples.webflow.io/

1 Like

Would it be possible to be able to see that in webflow? If I can already and I’m opening the link wrong please let me know :slight_smile:

1 Like

Hi, i am still working on this and am determined to make it work! Ideally I want to be able to filter jobs with 3 or 4 dropdowns - I have added one for now but when i pick an option it just clears all the container content. I really have no idea what I am doing here - would it be possible to take a look and see if you can see where I am going wrong? Thanks!

https://preview.webflow.com/preview/mixituptesting?utm_medium=preview_link&utm_source=dashboard&utm_content=mixituptesting&preview=61641e737e17122e95178906c6400284&mode=preview

https://mixituptesting.webflow.io/

I just put static options in the filter select for now to try and keep it simple.

Thanks!

1 Like