Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form
For using any advanced filtering option, all filter triggering elements (buttons, search field, checkboxes, radio buttons, etc) have to be inside the FORM.
You also will have to use some extra jQuery code snippet, which I recommend to put in the separate .js file
Main settings, which is necessary for make your content filtered is:
- container with filtered content should have an ID (we are using #container)
-all items, which will be filtered SHOULD have class .mix
For filter your content in several dimensions (size, color, etc...) all you need is add a combo classes to the elements.
For example, one element can have classes "category-1", "blue", "big", "square".
MixItUp will "read" the value of the input fields with type "select" and will react when checkbox will be checked.
First of all, you have to add a FORM to the page and give it an ID (I used #filterform)
Then, inside the form you can add as many select fields as much filter dimensions you will have (form, size, etc...). Inside the every select field you can add all options for filtering in particular dimension. Every option will have a VALUE equal to certain class name.
Option "All" will have no value.
Along with that you have to wrap every filter group (select field+title) in a div and give a class. You will need it for further connection with the plugin code.
For fast and easy clean all the filters we can use "Reset" buttons.
All you will need for that is a link-block or standard Webflow button with ID "reset".
Important note: button or link should be INSIDE THE FORM.
I recommend creating separate .js file for using advanced filtering settings, because Webflow limit custom code size to 5000 characters.
Don't forget to change parameters in the code if you will use different classes or IDs
Create a .js file with the code above and host it in any cloud service (Dropbox, Google Drive, etc), so you could use the public link to it and connect that file to your site.
For connect this plugin you will have to add custom code to the site settings (pic1) or page settings (pic2) before </body> tag.
As I mentioned in the general setup (mixitup-main), first you will need a link to main .js file of plugin.
In my case I used public link
<script src="http://cdn.jsdelivr.net/jquery.mixitup/latest/jquery.mixitup.min.js" type="text/javascript"></script>
Nex line, we are connecting advanced filtering .js file:
<script src="link to your hosted file here" type="text/javascript"></script>
After this line of code you have to add a code, which will call jQuery plugin.
There is also exist code snippet, which will let you to have a search function for your filtering content
(credits http://codepen.io/edprats/pen/pzAdg).
1) Add an input field with type="search" inside the form (use embed code)
2) Add an extra piece of code to the snippet in the footer area
Before we get to the finish, there is one small but crucial CSS rule you must add to the project:
filtering elements should have setting display:none
So, do not forget to apply display:none to class .mix before publish the site
When MixItUp plugin will load, it will add the display value as an inline-style (the default is “inline-block”).