Canvas Pages and Modules
3.0.0
3.0.0
  • Welcome
  • PAGES
    • Page Flair Group
    • Free Bubble Marketing Page
    • Premium Bubble Marketing Page
    • Centered Profile Page
    • Left-Justified Profile Page
    • Standard Page
    • Toggle Tabs Page
    • Menu Page
    • Mobile Menu Page
    • Video List Page
    • Standard Portal / Dashboard Page
    • Simple Portal / Dashboard Page with Icons
    • Double Sidebar Portal Page Template
    • Search Page
    • Map Search Page with Toggle and Filters
    • Floating Map Search Page
    • Search Bar Page
    • Multi-Step Page With Progress Bar
    • Standard Multi-Step Process Page
    • Multi-Step Process Page with Sidebar
    • Gallery Profile or Product Page
    • Sidebar Profile Page
    • 2-Column Menu Tabs Page
    • 2-Column Checkout Page
    • 2-Column Video Chat Page
    • Vertical Multi-Step Page Template
  • BLOCKS
    • Monthly Calendar Scheduling Widget
    • No Reply Comments Thread
    • Nested Comments Thread (with Like and Reply)
    • Placeholder Group
    • List with Circular Progress Bar Repeating Group
    • Top Input Chat Widget
    • Bottom Input Chat Widget
    • Toggle Tabs Group
    • Single-Select or Multi-Select Pill Tabs Group
    • To-Do List Repeating Group
    • Title Group with Button and Filters
    • Product Details Group With Progress Bar
    • Listing details with Icons and Menu Focus Group
    • Week Daily Availability Group
    • Frequently Asked Questions (FAQ) Repeating Group
    • Dismissible Module
    • Video Group
    • About Group
    • Add to Cart Group
    • Full Width Map with Directions Link
    • Location Module (Map and Directions)
    • Drag and Drop Repeating Group
    • Advanced Form Inputs Group
    • Reviews Repeating Group with User Images
    • Reviews (Text Only) Repeating Group
    • Nested Repeating Group
    • Standard Repeating Group with Image
    • Search Bar Group
    • Listing Details Group
    • Post Group with Upvoting UI
    • Large Chart Dashboard Widget
    • Chart With Key Metrics Dashboard Widget
    • Main Image with Thumbnails
    • Centered Profile Block
    • Left-justified Profile Block
    • Tile Image Gallery and Popup
    • Image Feed with Nested Comments Thread
    • 1-Column Standard Form Inputs Group
    • 2-Column Repeating Group (Text, Link, Image, and Description)
    • 2-Column Repeating Group (Link, Text, and Button)
    • 2-Column Repeating Group with Actions
    • 2-Column Grid Tiles Repeating Group
    • 2-Column Form Group
    • 2-Column Sortable List Repeating Group (With Image, Link, Star Rating, and Text)
    • 2-Column Table and Key Metrics Dashboard Widgets
    • 2-Column Progress Bar Chart Dashboard Widgets
    • 2-Column Chart and Key Metrics Dashboard Widgets
    • 2-Column Large Metrics Dashboard Widgets
    • 3-Column Large Metrics Dashboard Widgets
    • 3-Column Dashboard Widgets
    • 3-Column Repeating Group (Text, Link, Image, and Description)
    • 3-Column Text and Link Repeating Group
    • 3-Column Icons with Labels Repeating Group
    • 3-Column Grid Tiles Repeating Group
    • 3-Column Mini Grid Tiles Repeating Group
    • 3-Column Tiles with Buttons Repeating Group
    • 3-Column Horizontal Scroll Repeating Group
    • 4-Column Dashboard Widgets
    • 4-Column Large Metrics Dashboard Widgets
    • 4-Column Tiles Repeating Group
    • 4-Column Icon Tiles Repeating Group
    • 4-Column Profile Tiles Repeating Group
    • Standard Data Table
    • Mobile-Friendly Data Table
    • Standard Horizontal Scroll Data Table
    • Infinite Columns Horizontal Scroll Data Table
    • Infinite Columns Horizontal Scroll Data Table with Fixed First Column
  • Popups
    • Confirmation Popup
    • Message Popup
    • Image Popup
    • Video Popup
    • Vertical Scroll Popup
    • Edit Popup
    • Standard Form Popup
    • Subscribe Popup
    • Feedback / Contact Popup
    • Details Popup
    • Add List Popup
    • Advanced Form Popup
    • Rating Popup
    • Toggle Tabs Popup
    • Share Popup
    • Multi-Step Popup
    • Invoice Popup
    • Stripe Credit Card Purchase Popup
    • View Profile Popup
    • Send Message Popup
    • Multi-Select Pill Tabs Popup
    • Pricing Plans Popup
  • Reusables
    • filters_template
    • menufocus_template or Menu options (︙)
Powered by GitBook
On this page
  • Overview
  • Structure
  • How to set up
  • How to add a non-list filter
  • How to set up the UI
  • How to create a custom state on the reusable
  • How to modify the update button's workflow to set the value of the custom state
  • How to use a reusable custom state value in a repeating group on a page
  • How to add a list filter
  • How to set up the UI
  • How to create a list custom state on the reusable
  • How to modify the update button's workflow to set the value of the list custom state
  • How to use a reusable custom state value in a repeating group on a page

Was this helpful?

  1. Reusables

filters_template

PreviousPricing Plans PopupNextmenufocus_template or Menu options (︙)

Last updated 4 years ago

Was this helpful?

Overview

This is a reusable element that includes a focus group for applying filters to a repeating group. No workflows are associated with this module.

Structure

  • This reusable contains a focus group that includes common filter UI components.

  • This page comes with one popup:

    • contains two groups:

      • var - Website object This group stores the website object (e.g., app name, primary color, etc.)

      • var - dummy data A placeholder group in case you want to use any hidden variable groups later.

  • This reusable has a state of type text

    • You can pass either 'dropdown' or 'icon' text upon page load. This will determine what filter style type is shown.

How to set up

  • Make a copy of the filters_template reusable element for each type of data that you will query, and rename it so that you can easily find it when adding it above repeating groups.

    • For example, if you are creating a search page that allows website visitors to filter Users, your copied reusable element could be called filters_users.

      • This will preserve the original filters_template so that you have a blank copy for any other data types in the future.

    • Then, back on the page where you will use this reusable, replace the filters_template instance with the copied instance (filters_users in this example).

  • Within the copied reusable (filters_users in this example), add or remove any input elements in the focus group to fit your use case.

    • You can show or hide a section by selecting the parent group and checking/unchecking the box for This element is visible on page load.

    • Not all filters_template copies will need a "type of content" or a "data source" unless your filters are dynamic based on a single unique Thing's data source. You can leave the "type of content" and "data source" blank in most cases.

If you add or remove filters, please resize Group PLACEHOLDER filters to avoid overlapping with any other elements (for responsiveness).

How to add a non-list filter

  • Because the filters_template is a reusable element, we need to add custom states to the reusable element, so that the filter input values are accessible on different pages in your app.

    • If you don't set up these custom states, the values from the inputs will not be accessible to the parent page, and it won't be possible to use the input values to filter searches.

  • In the example described above of filtering a list of Users, we can create a single "keyword" custom state to filter our list of Users. At a high level, we need to:

    • Set up the UI for this filter (e.g., Input keyword within the group focus)

    • Create a custom state on the reusable element that can store the value of this keyword custom state.

    • Modify the Button Update element's workflow so that the "keyword" custom state value is always equal to the value of its related input.

    • Utilize the reusable element's custom state value as a constraint in a repeating group on a page to filter the repeating group's results.

How to set up the UI

  • Make sure the group focus element has the UI you need for this non-list filter. This can be any non-list input element. In this example, we'll use a standard input so that website visitors can enter a keyword and filter a list of Users by that keyword:

How to create a custom state on the reusable

  • Our keyword input is not a list, and it is of type "text" in this example. We need to store this value in a custom state so it's accessible on other pages in the app.

  • To create this custom state, open the reusable element's property editor. Then click on the small "i" icon to open the reusable's Element inspector panel. This is where we can create custom states:

  • After clicking on "add a new custom state" Bubble will prompt you to name the state name, state type, and whether this state is a list.

  • In the "keyword" example, we can define these properties:

    • State name: keyword

      • The custom state's name is "keyword" which serves as a label for our custom state. Similar to naming fields, the state name can be any name you choose (e.g., keyword, keyword filter value, etc.)

    • State type: text

      • The custom state's type is "text" because the value of the Standard input's type is of type text.

    • List: unchecked (no, it's not a list)

      • This keyword filter will always be the value that the user entered into a standard input element. It is a single text and not a list of texts.

  • Next, click Create to create a custom state. It will now appear in that reusable list of custom states.

How to modify the update button's workflow to set the value of the custom state

  • Now that our UI and our custom state are set up, the last step is to connect the keyword input to that custom state value. To do this, navigate to the Update button workflow:

  • In the first action of the workflow, click on the first action and click "Set another state":

  • Select the custom state ("keyword" in this example), and set the value to be its related input value ("Input filter keyword") in this example:

  • Now that this workflow is in place, clicking on the "Update" button in the group focus element will set the value of the custom state to be what the user typed into that input.

How to use a reusable custom state value in a repeating group on a page

  • Back on the page where this filters reusable is, add a constraint to your repeating group which filters the repeating group by this custom state value:

If you do not see your custom state, please make sure that you replace the filters_template reusable with the cloned reusable instance (e.g., filters_users in this example).

  • If your filters are not mandatory (e.g., they can be left empty), please make sure that "ignore empty constraints" is checked on the repeating group:

How to add a list filter

  • The steps to add a list filter are very similar to the steps above to add a non-list filter.

  • At a high level, we need to:

      • Set up the UI for this list filter (e.g., Repeating Group List within the group focus)

      • Create a custom state on the reusable element that can store the value of a list of things (e.g., a list of selected checkboxes).

      • Modify the Button Update element's workflow so that the "selected list" custom state value is always equal to the value of its related input.

      • Utilize the reusable element's custom state value as a constraint in a repeating group on a page to filter the results.

How to set up the UI

  • Make sure the group focus element has the UI you need for this list filter. This can be any list-compatible input element or custom UI (e.g., a custom checkbox repeating group, a multiselect dropdown).

  • In this example, we'll modify Canvas' checkbox repeating group so that Users can select different Specializations and filter a list of Users by those Specializations:

  • By default, this repeating group's type of content and data source will display "Dummy" content. First, change this type of content to your multi-select checkboxes' type of content. In this example, we can change this to "Specializations".

  • By default, the RepeatingGroup List element has a custom state on it called "selectedlist". Please change this list's type of content to match your multiselect checkboxes' type of content (as shown below), and make sure the type of content for all elements within this repeating group matches as well.

    • This will fix the errors that popped up after switching the repeating group's type of content.

How to create a list custom state on the reusable

  • Now that the multi-select checkbox repeating group is set up, we can create a list custom state that stores the list of values that the user selects. In this example, website visitors can select a list of "Specializations", so the list custom state can be called "specializations".

  • Our repeating group of Specializations is a list, and it is of type "Specialization" in this example. We need to store this value in a custom state so that it's accessible on other pages in the app.

  • To create this custom state, open the reusable element's property editor. Then click on the small "i" icon to open the reusable's Element inspector panel. This is where we can create custom states:

  • After clicking on "add a new custom state", Bubble will prompt you to name the state name, state type, and whether this state is a list.

  • In the "specializations" example, we can define these properties:

    • State name: specializations

      • The custom state's name is "specializations" which serves as a label for our custom state. Similar to naming fields, this can be any name you choose (e.g., specializations, specializations filter, selected specializations, etc.)

    • State type: Specialization

      • The custom state's type is "Specialization" because the multiselect checkbox repeating group's type of content is "Specialization" in this example.

    • List: checked (yes, it's a list)

      • This "specializations" filter will always be the list of Specializations that the user clicked on within the multiselect checkbox repeating group. It is a list of Specializations since the User can select more than one Specialization if they would like to.

  • Next, click Create to create a custom state. It will now appear in that reusable list of custom states.

How to modify the update button's workflow to set the value of the list custom state

  • Now that our UI and our custom state are set up, the last step is to connect the keyword input to that custom state value. To do this, navigate to the Update button workflow:

  • Because this action will set the value of a list custom state and not a single value custom state, the list custom state needs to be set in its own action. To do this, click to add a new "Set state" action (Element actions --> All elements --> set state):

  • In the set state action, select your reusable as the "element", select your custom state ("Specializations" in this example), and set the value to be the RepeatingGroup List's "selected list" custom state value:

  • Now that this workflow is in place clicking on the Button Update filters element in the group focus element will set the value of the custom state to be what the user typed into that input.

How to use a reusable custom state value in a repeating group on a page

  • Back on the page where this filters reusable is, add a constraint to your repeating group, which filters the repeating group by this list custom state value:

If you do not see your custom state, please make sure that you replace the filters_template reusable with the cloned reusable instance (e.g., filters_users in this example).

  • If your filters are not mandatory (e.g., they can be left empty), please make sure that "ignore empty constraints" is checked on the repeating group:

Popup Hidden Variables
Checkbox default state