Search Displays¶
Search Displays are powerful visualization components that allow you to present search results in various formats on your site.
Search Displays serve as the foundation for making your SearchKit results accessible and useful across your CiviCRM implementation.
Adding a Display¶
Each search can have zero, one, or multiple displays; giving you the flexibility to present the same data in multiple ways. To add a display, click the "Add..." button on the left side when editing your saved search.
Default Display
Every search can be displayed as a table without creating a display - that's what you see when clicking the "Search" button. This "Search results table" can be viewed as a standalone page or even embedded in a form in-lieu of creating a display. However, you'll typically want to create your own display instead of using the default so you can set some configuration options.
Display Types¶
When adding a search display, you'll first choose the type from the dropdown list:
- Table: Displays results in rows and columns, with an optional pager and selectable actions. The styling of rows and columns is highly configurable.
- List: Display results on one or more lines. Each field can be styled differently or given a custom css class.
- Grid: Useful for image gallery thumbnails and other content to show side-by side.
- Tree: Represent hierarchical data in a nested tree structure.
- Data Entry: Unlike the above displays which output data, this creates a spreadsheet-like input form for batch data entry.
- Autocomplete: Autocomplete fields give results from the search as the user types. An autocomplete display allows customization of how each result appears in the dropdown. Once created, the display can be selected for use in FormBuilder, or select "Make Default Autocomplte" to affect forms site-wide.
- DB Entity: Creates a database table or view which can be accessed with SearchKit, the API, or SQL-based tools.
Additional extensions¶
More search displays are provided by extensions in the Extensions Directory:
- ChartKit: Enable this extension (already bundled with CiviCRM core) for data visualisation in the form of plots, charts, and graphs.
- SearchKit Calendar: Download this extension for a time-based display of events, activities, etc.
- SearchKit Maps: Download this extension to show the location of contacts, events, etc. on a map.
- SearchKit Tokens: Download this extension to create your own tokens with SearchKit, for use in mailings.
- SearchKit Column Display: Download this extension for a display that stacks fields into columns.
- And more: Check the Extensions Directory for the latest additions.
Configuration Options¶
Each Search Display can be customized with various settings:
- Field selection and ordering
- Column headers and labels
- Sorting preferences
- Link configurations
- Inline editing capabilities
- Access permissions
- Display-specific styling
- Pagination settings
- Formatting and rewriting results
Rewriting Results in Search Displays¶
Search Displays offer powerful field rewriting capabilities that allow you to customize how data is presented to users.
Basic Field Combining¶
You can combine multiple fields using square brackets to reference field names:
[first_name] [last_name]
[street_address], [city] [postal_code]
Smarty Rewrites¶
For more complex formatting, you can use Smarty template syntax with curly brackets:
- Conditional Display:
{if $nick_name}[nick_name]{else}[first_name]{/if} [last_name]
- Math Operations:
{$total_amount - $fee_amount}
- Value Transformation:
{if $age_years >= 18}Adult{else}Minor{/if}
Tips¶
- Field names in square brackets (e.g.
[display_name]
) are replaced with their values automatically - Use
{$field_name}
to access field values in Smarty code - Smarty modifiers like
|date_format
and|crmMoney
help with common formatting needs - You can combine both square bracket and Smarty syntax in the same rewrite
Tip
Rewritten fields are display-only and won't affect the underlying data storage.