{"id":4905,"date":"2020-06-03T09:38:05","date_gmt":"2020-06-03T09:38:05","guid":{"rendered":"https:\/\/the7kennisbank.nl\/?p=4905"},"modified":"2020-06-09T12:13:45","modified_gmt":"2020-06-09T12:13:45","slug":"guide-create-a-facet","status":"publish","type":"post","link":"https:\/\/the7kennisbank.nl\/en\/wp-grid-builder\/guide-create-a-facet\/","title":{"rendered":"Guide create a facet"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>&nbsp;<\/p>\n<div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element \" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<div class=\"container flex items-center justify-between\">\n<h1 class=\"entry-title\">Create a Facet<\/h1>\n<\/div>\n<div id=\"article-wrapper\" class=\"container\">\n<p>A facet allows to filter, load, sort or reset content. A facet is always attached to a grid (or <a href=\"https:\/\/the7kennisbank.nl\/wp-grid-builder\/resources\/function-render-template\/\">template<\/a>) because a page\/post can contains several grids (or templates).<br \/>\nIn this guide, we will show you the main steps to create a facet filter.<\/p>\n<p>At first you need to select which kind of action your facet will apply on your grid:<\/p>\n<ul>\n<li><strong>Filter<\/strong> content from Taxonomy terms, WordPress fields or custom fields<\/li>\n<li><strong>Load<\/strong> content with a pagination or load more button<\/li>\n<li><strong>Sort<\/strong> content from WordPress fields or custom fields<\/li>\n<li><strong>Reset<\/strong> content depending of facets if needed<\/li>\n<\/ul>\n<p><a href=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/04\/facet-settings-actions-1024x576-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1236\" src=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/04\/facet-settings-actions-1024x576-1.png\" alt=\"Set up a facet action\" width=\"1024\" height=\"576\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Facet settings \u2013 Facet action<\/p>\n<p>If you set filter as facet action, you need to set the data source of your filter. It means that you need to set which kind of data from WordPress will be used to filter your grid content. You can filter by:<\/p>\n<ul>\n<li><strong>Taxonomy<\/strong> terms<\/li>\n<li><strong>WordPress field<\/strong><\/li>\n<li><strong>Custom field<\/strong><\/li>\n<\/ul>\n<p><a href=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/04\/facet-settings-filter-source-1024x576-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1240\" src=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/04\/facet-settings-filter-source-1024x576-1.png\" alt=\"Set up facet data source\" width=\"1024\" height=\"576\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Facet settings \u2013 Data source<\/p>\n<p>You will also be able to set the number of choices diplayed in your facet thanks to <strong>Choices Number<\/strong> settings. Depending of the filter type, you will be able to limit the number of choices displayed on load thanks to <strong>Limit Choices Number<\/strong> option. If <strong>Limit Choices Number<\/strong> is inferior to the <strong>Choices Number<\/strong> then a toggle button will be displayed at the bottom of the facet to show more choices on click.<\/p>\n<p><a href=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/04\/facet-settings-filter-number-1024x576-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1243\" src=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/04\/facet-settings-filter-number-1024x576-1.png\" alt=\"Set up number of choices\" width=\"1024\" height=\"576\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Facet settings \u2013 Choices number<\/p>\n<p>All other facet settings have descriptions in the admin interface and are self explanatory. Each facet action and filter has its own settings.<\/p>\n<p>In order to efficiently filter content, each facet are indexed in an custom index table. It means, that everytime you create a facet, <strong>the plugin automatically queries and stores all facet values according to your facet settings<\/strong>. This process is called indexing and simply allows to \u201cprefetch\u201d results and to store them in a simple and indexed table.<\/p>\n<p>Sometime, you may need to <strong>manually re-index your facets<\/strong>. You can re-index each facet independently in facet settings page or in facets overview page:<\/p>\n<\/div>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-6\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div  class=\"wpb_single_image wpb_content_element vc_align_left\">\n\t\t\n\t\t<figure class=\"wpb_wrapper vc_figure\">\n\t\t\t<a href=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-4.png\" target=\"_self\"  class=\"vc_single_image-wrapper   vc_box_border_grey rollover\" data-large_image_width=\"1024\" data-large_image_height = \"576\"     ><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-4.png\" class=\"vc_single_image-img attachment-full\" alt=\"\" title=\"card-builder-color-schemes-1024x576-1\" srcset=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-4.png 1024w, https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-4-300x169.png 300w, https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-4-768x432.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"  data-dt-location=\"https:\/\/the7kennisbank.nl\/en\/wp-grid-builder\/guide-create-a-facet\/attachment\/card-builder-color-schemes-1024x576-1-5\/\" \/><\/a>\n\t\t<\/figure>\n\t<\/div>\n\n\t<div class=\"wpb_text_column wpb_content_element \" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p style=\"text-align: center;\">Facet settings \u2013 Re-index<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><div class=\"wpb_column vc_column_container vc_col-sm-6\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div  class=\"wpb_single_image wpb_content_element vc_align_left\">\n\t\t\n\t\t<figure class=\"wpb_wrapper vc_figure\">\n\t\t\t<a href=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-5.png\" target=\"_self\"  class=\"vc_single_image-wrapper   vc_box_border_grey rollover\" data-large_image_width=\"1024\" data-large_image_height = \"576\"     ><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-5.png\" class=\"vc_single_image-img attachment-full\" alt=\"\" title=\"card-builder-color-schemes-1024x576-1\" srcset=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-5.png 1024w, https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-5-300x169.png 300w, https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/06\/card-builder-color-schemes-1024x576-1-5-768x432.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"  data-dt-location=\"https:\/\/the7kennisbank.nl\/en\/wp-grid-builder\/guide-create-a-facet\/attachment\/card-builder-color-schemes-1024x576-1-6\/\" \/><\/a>\n\t\t<\/figure>\n\t<\/div>\n\n\t<div class=\"wpb_text_column wpb_content_element \" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p style=\"text-align: center;\">Facets overview \u2013 Re-index<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element \" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>At any time, you can also <strong>stop the indexer<\/strong> or <strong>clear the index table<\/strong> in order to start re-indexing your facets if any issue occured. You will find, in <strong>Global Settings &gt; General<\/strong>, buttons to stop the indexer and to clear the inde table:<\/p>\n<p><a href=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/04\/global-settings-indexer-1024x576-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1248\" src=\"https:\/\/the7kennisbank.nl\/wp-content\/uploads\/2020\/04\/global-settings-indexer-1024x576-1.png\" alt=\"Global settings - Indexer\" width=\"1024\" height=\"576\" \/><\/a><\/p>\n<p>Global settings \u2013 Indexer<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>&nbsp;<\/p>\n","protected":false},"author":2,"featured_media":5005,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[44,52,43],"tags":[],"class_list":["post-4905","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-documentation","category-guides","category-wp-grid-builder","category-44","category-52","category-43","description-off"],"acf":[],"_links":{"self":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/4905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/comments?post=4905"}],"version-history":[{"count":12,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/4905\/revisions"}],"predecessor-version":[{"id":6097,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/4905\/revisions\/6097"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/media\/5005"}],"wp:attachment":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/media?parent=4905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/categories?post=4905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/tags?post=4905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}