Search templates
What are Search templates?
Cludo offers two global templates that can easily be implemented onto the website. Currently, two global templates are supported:
- Inline: Displays the results on a dedicated search result page that the user is directed to upon searching.
- Overlay: Displays the results in an overlay that will appear on any page upon searching.
Typically, a search template is split into two components:
- An element for initiating a search, such as a search input or a link to the search.
- An element for displaying the results. Also commonly referred to as a SERP (Search Engine Result Page). This result page may also utilize different facets of filters and show categories for further filtering of the search results.
Because search templates should be matching the rest of the website, depending on the requirements of both the features and visual appearance, it is possible to utilize the global templates offered by Cludo. Alternatively, custom templates can be developed based on the specific needs of the website.
It is also possible to implement Cludo via API.
How to implement Cludo using a Search template
Cludo offers two global templates that can easily be implemented by copying and pasting code snippets onto the website. This solution is a safe and easy way to implement Cludo out-of-the-box. Alternatively, more custom templates can be created, which will require a more custom code implementation. If you are having a custom solution done by Cludo, you will receive custom documentation for this, as it won’t be found in MyCludo.
Currently, two global templates are supported:
- Inline: Displays the results on a dedicated search result page that the user is directed to upon searching.
- Overlay: Displays the results in an overlay that will appear on any page upon searching.
Both templates come with default styling, but you can always add additional customizations through your own stylesheet.
How to implement the inline template
- In the navigation, select Configuration › Search template.
- Select the engine to install the template for in the list.
- Select the Inline option.
- Click the Next button.
- Choose if the search results should also show categories and images.
- Click the Next button.
- Enter the URL of the search result page in the Results page URL field.
- Click the Next button.
- Implement the listed code snippets from the page:
- Add the search form where it should appear.
- Add the default stylesheet to the header.
- Add the script just before the closing body tag (
</body>
) on all pages. - Add the search results snippet on the search results page.
- You have now successfully implemented the inline template!
![](https://supportsanddev.wpengine.com/wp-content/uploads/2022/12/image-17-1024x911.png)
How to implement the overlay template
- In the navigation, select Configuration › Search template.
- Select the engine to install the template for in the list.
- Select the Overlay option.
- Click the Next button.
- Choose if the search bar is already implemented or if you want to inject a new search bar in the left or right corner of the page.
- Click the Next button.
- Implement the listed code snippets from the page:
- Add the link tag to the header of all the web pages to correctly style the template.
- Add the script just before the closing body tag (
</body>
) on all pages.
- You have now successfully implemented the overlay template!
![](https://supportsanddev.wpengine.com/wp-content/uploads/2022/12/image-16-1024x578.png)
How to style Search templates
Once a search template is implemented correctly, CSS can be used to further style the template to match the visuals of the rest of the website.
When using the global search templates like Overlay or Inline, the following CSS selectors can be used modify certain elements.
Overlay
Edit banner colors
Add the following to the cludoSettings object in the script:
themeBannerColor: {textColor: '#HEX', backgroundColor: '#HEX'},
Inline
Styling the search results
.cludo-search-results-item {
/* Insert styling */
}
.cludo-search-results-item__title-anchor {
/* Insert styling */
}
.cludo-search-results-item__title {
/* Insert styling */
}
.cludo-search-results-item__description {
/* Insert styling */
}
.cludo-search-results-item__path-anchor {
/* Insert styling */
}
Styling the search filters (categories)
.cludo-facet {
/* Insert styling */
}
.cludo-facet__header {
/* Insert styling */
}
.cludo-facet__value-list-item {
/* Insert styling */
}
.cludo-facet__value-list-item.active {
/* Insert styling */
}