Site Search

Site search is a collection of custom Brics that are designed to make the process of adding search to a Blocs website incredibly easy. The setup process is simple, start by adding the main site search Bric to any Blocs website then ensure all pages have SEO keywords set in the Blocs page settings and Blocs with handle the rest.

Site Search is available to buy at the Blocs Store.

Site Search Bric

This Bric adds a search input field to your website. Its presence on a project page, will ensure Blocs creates and indexes all of the pages in your site, so that they show as search results when a search query is inputted into the search field.

The keywords and the SEO page name values, from page settings, are used as search tags for each page. If a page has a description set, it will also show in the search results, beneath the result title.

Exclude Page Bric

There may be some pages on your site that you would like to exclude from site search. To exclude any page, simply place the Exclude Page Bric into the dynamic content area of a page. This will prevent Blocs from indexing the page for site search.

Beginners Tip

Please take care not to place the exclude page Bric in one of the projects Global Areas, as this will prevent all pages being indexed for search.

As well as the pages of your site, you may also wish to include external URLs as part of your site’s search functionality. To do this, place a single instance of the External Link Bric on your site and populate it via the sidebar inspector controls with the external links you would like to include as part of your site search.

Preview Support

Site search supports all in app preview modes, however, once you export to your local file system, site search will not function correctly by simply opening the local html file, in a web browser, it will need to be run from a web server. Once your site is hosted, the search functionality will work as expected.

Customisation

The site search input field and results drop down offer various customisation options via the sidebar options, however, you may wish to customise the visual appearance of the input field and results drop down further. This can be done using the following subclasses in combination with the Class Manager and Class Editor.

.blocs-site-search-container input – Use this class to style the main search input field.

.blocs-search-results – Use this class to style the results drop down container.

.blocs-search-results .dropdown-item – Use this class to style the results drop down items.

Trouble Shooting

Q. The current page is not shown in the search result drop down?

A. That is normal. The current page is filtered out of search results for obvious reasons.

Q. None of my pages are shown in the search results drop down and they all have valid SEO keyword data?

A. Take care to ensure that you do not have an exclude page Bric located in one of the Global Areas.

Q. Does site search scan all of the content on each page to find results?

A. No. Site search is intended as a lightweight, fast and efficient search solution. The results for pages are filtered by the page name and keywords that are entered into a pages keyword SEO settings.

Q. Does site search show results in a results page?

A. No. Site search results are shown in real time. When text is entered into the site search input field, the possible results are displayed in a drop down field.

Q. Can I customise the visual appearance of the site search input field and results drop down?

A. Yes, please see the further customisation section above.

Q. How do I update the Site Search Brics?

A. You can read this guide on updating Brics, using the Extension Manager.

Q. I purchased the Site Search Bric, how do I download it again?

A. The Site Search Bric is sold via the Blocs Store, we use Paddle for distribution. You can log into My Paddle and access your previous orders.

Updated on 6th October 2023

Was this article helpful?

Related Articles