Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
v2 Embed Filtering
<script type="text/javascript">
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
})(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
_st('install','YOUR_INSTALL_KEY','2.0.0', {
install: {
hooks: {
query_filter: function(query) {
query.setFilterDataByDocumentTypeSlugAndFilterField('page', 'FIELD_NAME', { values: ['VALUE1', 'VALUE2'], type: "and" });
return query;
}
}
}
});
</script>
@mikeisonthenets

This comment has been minimized.

Copy link
Owner Author

commented Apr 19, 2017

  • Update the values above that are in ALL CAPS
  • The filter type will default to or
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.