Notes
Notes
- The component fetches search results from an Azure Search API endpoint. The URL is resolved from the datasource item via the
DataSourceUrlmodel property. - Facets are preloaded on page load by appending
?facetsonly=1to the search URL. Facet dropdowns are rendered client-side using Mustache templates. - Search results support pagination via a "Load More" button that increments the page parameter.
- The
contextItemattribute is passed as asearchBlockContextItemHTTP header to scope search results to the current content context. - Facet dropdowns support both single-select and multi-select modes, controlled by the
SingleSelectflag from the API response. - Results display a thumbnail image (if available), title with a stretched link, and description text.
- The component integrates with the favorites system via
loadFavorites()after results are rendered. - Dictionary items should be used for localizable strings (search placeholder, load more, results count, filter labels) — currently hardcoded with TODO markers.
Control Properties
Resource Search
A resource-specific search interface tailored for Business Hub content. Provides filtered search across resources with category facets, date range filtering, and content type selectors.
Control Properties
This component has no Sitecore rendering parameters template. Configuration is driven by the datasource item and rendering contents resolver.
| Property | Source | Description |
|---|---|---|
| DataSourceUrl | Model (resolved) | The URL of the Azure Search API endpoint. Resolved from the datasource item by the rendering contents resolver ({B1CED76D-CA6C-46BE-AC52-0BDA10E45864}). |
| ContextItem | Model (resolved) | The Sitecore item ID used to scope search results. Passed as the searchBlockContextItem HTTP header in API requests. |
| Column classes | BSTools5 parameters | Standard column sizing, offset, and padding classes inherited from BSTools5 column rendering parameters. |
| AddClass | BSTools5 parameters | Additional CSS classes appended to the component wrapper. |
Template Properties
Template Properties
| Template | Path | Description |
|---|---|---|
| JsonBuildingBlock | /sitecore/templates/Foundation/AzureSearch/JsonBuildingBlock | Datasource template for the rendering. Defines the search configuration used by the rendering contents resolver to produce the DataSourceUrl and ContextItem model properties. |
Datasource Location: /sitecore/content/Business Hub/Home/api/search
Rendering Contents Resolver: {B1CED76D-CA6C-46BE-AC52-0BDA10E45864} — resolves the search API URL and context item from the datasource.
Model: ResourceSearch with two bound properties: DataSourceUrl (string) and ContextItem (string), both decorated with [SitecoreComponentField].