Documentation
HomeForumHelp
  • About Cwicly
  • Beginner's Guide
    • Install Cwicly
    • Getting Started
      • Overview
      • Settings
    • Edit and Manage your Site
    • The WordPress Dashboard
    • The Dashboard Menu
    • Site Editor
    • Create your Front Page
      • Front Page
      • Header
        • Header Template Part
        • Structure
      • Footer
        • Footer Template Part
        • Structure
  • ⚡Cwicly
    • Block ID
    • Breakpoints
    • Class
      • Global/Block Classes
    • Cloud Design Library
      • Create an Account
      • Overview of the Cloud Dashboard
      • Editor: Cloud Library
        • Access from the Editor
        • Add a Library
        • Switch between Libraries
        • Default Library
        • Download Library
        • Remove Library
        • Categories
          • All
          • Popular
          • Button
          • Composition
          • Decorative
          • Interactive
          • Layout
          • Media
          • Menu
          • Social
      • Design Blocks: Cloud Library
        • Search for a Design Block
        • Refresh
        • Add Design Block
        • Save Design to Library
        • Remove Design Block
      • Library Globals
        • Library: Global Styles
          • Library: Add Styles
          • Installation: Add Styles
          • Library: Style Settings
        • Library: Global Classes
          • Library: Add Classes
          • Installation: Add Classes
          • Library: Class Settings
        • Library: Global Stylesheets
          • Library: Add Stylesheet
          • Installation: Add Stylesheet
          • Library: Stylesheet Settings
        • Library: External Classes
          • Library: Add External Classes
          • Installation: Add External Classes
          • Library: External Classes Settings
      • Community Library
        • Save to Community Library
        • Download from Community Library
        • Remove from Community Library
        • Set Community as default
    • Colour Picker
      • Gradient Builder
    • Components
      • Components Library
      • Components Folders
      • Settings
      • Component Properties Modal
      • Properties (Add)
        • Text Property
        • Rich Text Property
        • List Property
        • Link Property
        • Image Property
        • Gallery Property
        • Video Property
        • Icon Property
        • Colour Property
        • Toggle Property
        • Number Property
        • Class Property
        • ID Property
        • Options Property
        • Conditions Property
        • Visibility Property
        • CSS Text Property
    • Copy/Paste
      • Block Styles
      • Classes & IDs
      • Dynamic Preview
      • Global Styles
      • Global Classes & Stylesheets
      • Blocks
    • CSS Grid
    • Dynamic Inserter
    • Font Manager
    • Navigator
    • Quick Inserter
    • Scaling
    • Smart Inserter
    • Span
    • Tag
  • ⛵Tailwind
    • Getting Started
      • About
      • Activate
      • Copy/Paste
      • Enable editing mode
      • Apply a Class
      • Pseudo state Management
      • Automatically Sync
        • Breakpoints
        • Colours
      • Shells
      • Custom Tailwind Configuration
      • Import Tailwind Plugins
  • 🖌️Themer
    • Themer
      • Templates
      • Parts
      • Fragments
    • Role Editor
      • User Role
      • Gutenberg Editor
      • Global Block Behaviour
      • Block Toolbar
      • Miscellaneous
      • Components
      • Code Block
      • Blocks
      • Post Types
      • Force iFrame
      • Client Canvas View
      • Help
      • User
  • 🌐Global Styles
    • Global Styles
      • Global Colours
        • Folders
        • Colour tab
        • Palette tab
        • Modifiers tab
          • Opacity
          • Lighten
          • Darken
          • Saturate
          • Desaturate
          • Spin
      • Dark Mode
      • Global Gradients
      • Global Typography
      • Global Block Typography
      • Theme Elements
      • Global Settings
        • Defaults
        • Backend
      • Remove Gutenberg Global Styles
    • Global Classes & Stylesheets
      • Global Classes
      • Global Stylesheets
      • External Classes
  • 🎨Design
    • Background
      • Background Colors
      • Background Source
      • Sizing & Positioning
      • Styling
    • Typography
      • Typography
      • Rem conversion
      • Global Typography
      • Text Align
      • Font Family
      • Font Size
      • Font Weight
      • Spacing
      • Line Height
      • Style
      • Decoration
      • Transform
      • White Space
      • Overflow Wrap
      • Word Break
      • Word Spacing
      • Axes
      • Text Colour
      • Link Colour
    • Fluid Values
    • Layout
      • Display
      • Visual
      • Position
    • Sizing
      • Height
      • Width
    • Margin & Padding
    • Borders
      • Border
      • Shadows
      • Outline
    • Effects
      • General
      • Transitions
      • Animations
      • Filters
      • Text Shadow
      • Tilter
      • Separators
    • Transforms
    • Pseudo Classes/Elements
    • Relative Styling
  • 🎓Advanced
    • Custom CSS
    • Quick Code
    • Scrolling
      • Animate On Scroll
      • Scroll Direction
    • Attributes
    • Tooltip
      • Source
      • Theme
        • Custom Theme
  • 👆Interactions
    • Visibility Conditions
      • Blocks
      • Themer
    • Link
      • Link Source
      • Link Action
    • Interactions
      • Trigger
      • Actions
    • Hover Animation
    • Dynamic Slider
      • Settings Tab
  • 🖥️Editor
    • Inserter Panel
    • Quick Insert
    • Block Inspector
    • Primary Tab
    • Design Tab
    • Advanced Tab
    • Responsive Selector
  • 🔧Blocks
    • Accordions
    • Accordion
      • Basics
      • Settings
      • Colours
      • Layout
      • Typography
      • Margin and Padding
    • Button
      • Add
      • Icon
    • Code
      • Enable/Disable
      • Add
      • Languages
      • Settings
    • Columns
      • Basics
      • Add
      • Settings
      • Grid Editor
        • Auto Grid
        • Auto Template
    • Column
    • Container
    • Div
    • Filter
      • Basics
      • Filter Editor
      • Create a Filter
      • Style a Filter (example)
    • Fragment
    • Gallery
      • Filter
      • Source
      • Settings
      • Text
      • Image Style
    • Heading
    • Hook
    • Icon
    • Image
      • Source
      • Size
      • Settings
      • Hover Animation
    • Input
      • Input Settings
    • List
      • List Types
      • Settings
      • Icon
    • Maps
      • Settings
      • Size
      • Style
      • Overlay Layout
      • Colours
    • Menu
      • Settings
      • Main Menu
      • Sub Menu
      • Items
    • Modal
      • Modal Style
      • Settings
      • Trigger
      • Animation
    • Nav
      • Nav Block Settings and Styles
      • Nav Items Block
      • Nav Dropdown Block
      • Nav Link
      • Custom Dropdown Block
      • Nav Menu
    • Post Content
    • Paragraph
    • Popover
    • Query
      • Query Settings
      • Query Editor
        • Posts
        • Terms
        • Users
        • Comments
    • Query Template
      • Layout
      • Grid editor
    • Repeater
      • Nested Repeater
    • Section
    • Slider
      • Settings
      • Navigation
      • Dots
    • Slide
    • Styler
    • SVG Block
    • Tab List
      • Tab
    • Tab Contents
      • Tab Content
    • Taxonomy Terms
    • Video
      • Source
      • Settings
      • Div Overlay
  • ⚙️Settings
    • Settings
    • License
    • Icon Collections
    • Font Sets
    • Google Maps API
    • Advanced Settings
    • Regeneration
    • WooCommerce
  • 🛒WooCommerce
    • Archive Page
    • Attributes
      • Colour Type
      • Image Type
    • Cart
    • Product Variations
    • Create a Product Type
      • Simple
      • Variable
        • Create Attributes
      • Grouped
      • External
    • Build a Single Product Page
    • Dynamic Content
    • Link
  • 🗃️Miscellaneous
    • Blocks Specifics
    • Icon Selector
    • Trailing Slash
    • Units
      • Default Units
    • Code Snippets
    • Shortcuts
    • Actions
    • Filters
    • Browser Console
  • 🔗Resources
    • Changelog
    • Roadmap
    • Forum
Powered by GitBook
On this page
  • Toggle on Frontend Rendering
  • Categories
  • Set up Filter
  • Open
  • Rename
  • Set Taxonomy Filter
  • Dynamic Toggle
  • Source
  • Key
  • Field
  • Copy Query ID
  • Add Filter
  • Connect Filter to Query
  • Query ID
  • Target
  • Key
  • Filter Type
  • Data Source
  • Data Type
  • Taxonomy
  • Filter categories
  • Connect dynamic data
  • Layout
  • Style
  • Relative Styling for button selection

Was this helpful?

  1. Blocks
  2. Filter

Create a Filter

Last updated 1 year ago

Was this helpful?

The filter block is able to filter anything inside a query block.

The filter block is usually inserted into a parent block.

Toggle on Frontend Rendering

  • Select the Query in the navigator.

  • In the Primary tab of the block Inspector open the Settings tab.

  • Toggle on Frontend Rendering.

The filter block will only work with a queryblock that has the front end rendering property toggled on.

Categories

For this example, we have already set up our Categories in the WordPress Dashboard.

  • Navigate to the Dashboard.

  • Open the Categories tab and add new categories as required.

  • In this example we have set up 3 categories.

Set up Filter

  • Select Query in the Navigator.

  • In the Primary Tab of the Block Inspector, open the Query Editor.

  • Open "Taxonomy Query".

Open

  • Click the "+" icon to add a new Taxonomy Query.

  • Click to open.

Rename

You can give you taxonomy filter a suitable name.

  • Find the Name field.

  • Input a suitable name.

Set Taxonomy Filter

In order to target Categories, you need to filter a Taxonomy, such as Categories, Tags, Navigation Menus, Link Categories, Formats, Themes, Tenplate Part Areas etc.

In this example, we wish to target Categories.

  • Set Taxonomy to "Categories - Post".

Dynamic Toggle

In order to filter dynamic data, you need to toggle on the Dynamic icon.

  • Find Terms.

  • Toggle on the "Dynamic" icon.

Source

  • Set Source to "WordPress".

The Filter block adds or removes a parameter that the Query then uses to modify the information that it displays.

  • Set Wordpress to "URL Parameter".

Key

You need to input the filter target name, in this example "Category".

  • Input "Category" as Key.

Field

By default, the filter returns taxonomy slugs. If required, you can set it to another parameter such as term_id, name, term-taxonomy_id. In this example we wish to return "slugs".

  • Select "slug" as Field in the Dropdown.

Copy Query ID

You need to copy the query ID so that the Filter can attach to the Query.

  • Find Query ID.

  • Copy using keyboard shortcuts.

Add Filter

Now we need to add our Filter. You can place it where you need it as required.

In this example we will place it above the Query.

  • Select the block into which you want to insert the Filter.

  • Add a Cwicly Filter block using the Quick Inserter or the Block Inserter.

  • You should see a placeholder with "Select Filter Properties...".

  • Click to open the Filter Editor from the Primary tab.

Connect Filter to Query

First we need to connect the Filter to the Query using the Query ID.

Query ID

  • In the Query Editor modal, input the ID of the Query to which you wish to attach the filter.

You can find the Query ID in the Query Editor.

  • Select the Query to which you want to attach the Filter.

  • In the Primary tab, open the Query Editor.

  • Copy the Query ID.

  • Input the required Target, in this example "category".

Target

The Target is in fact the key that you chose when you set up the Query. You will find it in the Taxonomy Query tab of the Query Editor.

  • Select the Query.

  • Open the Query Editor.

  • Open the Taxonomy Query tab.

  • Click the required Query, in this example the "Travel Query".

Key

Copy the Key, in this example "category" and input it into the Target field of the Filter Editor.

Filter Type

Select the Filter Type you require in the dropdown, in this example "Button Single".

Button Single allows you to choose only one Button at a time as opposed to "Button Multiple".

Data Source

  • Select required Data Source in the dropdown in the Filter Editor.

  • In this example, Dynamic as we want our data to be dynamic.

Data Type

  • Select required Data Type, in this example Taxonomy.

Taxonomy

Choose required taxonomy type in the dropdown, In this example want to target Categories as our Taxonomy type.

  • In the Taxonomy dropdown select required taxonomy type, in this example Categories.

In this example we want to exclude Uncategorised posts and only include those we previously set up in the Dashboard.

  • In the Taxonomy section of the Filter modal, select items to exclude in the Exclude dropdown.

  • In this example, "Uncategorised".

In this example we do not want to display terms that do not contain any posts.

  • In the Taxonomy section of the Filter modal, toggle on "Hide Empty" as required.

Filter categories

Now we want to be able to visualise and style the filter categories we have created.

  • With the Filter block selected, add a Paragraph.

Connect dynamic data

We need to connect our dynamic data.

  • Select the Paragraph and open Dynamic Values from the toolbar.

  • Select Filter as Source.

We want the Category names to appear.

  • Set Filter to Name.

Now you can visualise the three Categories we set up.

Layout

Let's turn our attention to the Layout of our Filter.

  • In the Primary tab, open the Layout tab.

  • Set Flex display, Row direction, Wrap (so that if there are multiple categories, they will display on the next line) and Align centre.

To add spacing around the filter items:

  • Set a Row Gap and a Column gap or !8px.

To Space the Filter items from the Query:

  • In the Margin and Padding tab, set a bottom Margin of 50px.

Style

Now we need to Style the Filter Titles.

  • In the Typography tab of the Primary tab, set an appropriate font size and weight.

  • In the Design tab, open the Borders tab and the Radius and Border tab.

  • Set a 40px equal Radius or as required to give a suitable oval look.

  • Set an appropriate Border colour, in this example dark grey.

  • Set a solid border Style with an equal 1px Width.

Set an appropriate Padding to allow the items to breathe.

  • In the Design tab, open the Margin and Padding tab and set an upper and lower 10px Padding and a 30px right and left Padding or as required.

Relative Styling for button selection

Now we have fully set up the Filter buttons but to make it easier for the User, we can add a colour change to the current button to let them know what category is selected.

  • With the Filter block selected, open the Design tab and the Relative Styling tab.

  • Click the "+" icon to add a new Relative Style.

We need to set the Rules under which this change will occur.

  • Click the "Rules" icon to open the Relative Styles Rules modal.

  • Input a suitable Name, in this example "Selected".

  • In "Rules after block class" set Combinator to "Descendent".

  • Set Type to Class.

  • Input "selected" as Selector since we wish the rule to apply to the selected filter item.

  • Click Create "selected" to create.

We want to add another Rule to target the selected paragraph.

  • Click the "+" icon in Rules after block class.

  • Set Combinator to Descendant.

  • Set Type to Class.

  • In the Navigator, right click on the Paragraph block contained inside the Filter block and copy the Class.

  • Paste the copied paragraph class into the Selector field.

It's time to style the relative styling we set up.

  • In the Design tab, open the Relative styling tab.

  • Click the required Relative Style you wish to customise, in this example "Selected".

In this example we want the white background to become black when selected.

  • In the Background tab, open the colours tab and choose a suitable background colour, in this example Black.

Let's style the text. In this example we want the text to change white when selected.

  • In the Typography tab, select a suitable Text colour, in this example white.

Now when a user selects a filter button, the background will turn black and the text white.

🔧