AJAX Search Form

Create a live search interface whose results use a custom Bricks template. Search posts, products, or other supported post types and optionally let visitors narrow the search by taxonomy.

Setup and First Use


Before starting, enable the relevant element or feature family under Bricks → BricksUltimate → General Elements, save, and reopen the Bricks editor. Integrations also require their corresponding plugin to be active.

  1. Create a Bricks template of type BricksUltimate - Ajax search result and publish it.
  2. Design the result layout in that template using a suitable query and current-result dynamic fields. Keep the result list lightweight.
  3. Add (BU)AJAX Search Form on the page, header, or Off Canvas panel.
  4. Select the intended Post type and configure the result Template and Query type controls.
  5. Set the placeholder, form and input Aria labels, search button, and optional category field.
  6. Style the input, category dropdown, loading state, result wrapper, and content layout. Save and test with actual search terms.

Controls and Settings


ControlPurpose and usage
Layout / Post typeChoose the form arrangement and the kind of records to search. A product catalog needs the product post type.
Enable category fieldAdds a taxonomy selector. Choose the matching taxonomy and optional term filters.
Term settingsTaxonomy, hide-empty, parent/depth, include/exclude IDs, ordering, and labels shape the category selector.
Meta queryUse the exposed relation, meta-key, comparison, and type controls when search needs an additional metadata constraint. Start without them and validate one condition at a time.
Template / Query typeConnect the custom search-result layout to the search. A form with no valid result template cannot display a useful designed result list.
Content Wrapper / Content LayoutControl result dimensions, position, z-index, and overflow independently of the input.
Search button / Loading iconCustomize icon, dimensions, colors, and feedback. Give an icon-only search button an accessible name.

Build Results for the Search Context


Use the result record for image, title, permalink, and product data. Avoid hard-coded content or a restrictive template query that excludes every search match. Search is not automatically a full faceted catalog, fuzzy search, or an external search service.

Placement and Performance


A header search dropdown must escape clipping and sit above nearby content. Check ancestor overflow and stacking before increasing z-index. Use appropriately sized thumbnails, modest result counts, and concise result cards; test after a popup or panel is opened if the form lives there.

Practical Example


Build a product header search with a Product categories selector. Design a compact result row with image, product title, price, and link, and test one matching term, one partial term, and a term with no results.

Troubleshooting


  • Wrong records: inspect Post type, taxonomy, template query, and metadata constraints.
  • Nothing renders: select the correct published result template and inspect the AJAX response.
  • Dropdown cut off: review container overflow, wrapper dimensions, and stacking.
  • Repeated or stale results: check page caching and whether a dynamic template accidentally uses fixed IDs.

Related Documentation