Add Search to Blocs Websites
Blocs websites can finally have native search functionality thanks to the new Bric from the developer of Blocs app.
Site Search is not just one Bric, it is actually a collection of Brics that are designed to make the process of adding search to a Blocs website incredibly simple and easy.
The setup process is fast and efficient, simply add the main site search Bric to any Blocs website, ensure all pages have SEO keywords set in the standard Blocs page settings window and Blocs with handle the rest.
Site search is broken down into 3 easy to use Brics.
Site Search Bric
This Bric adds a search input field to your site, its presence on a Blocs website will ensure Blocs creates and indexes all of the pages in your site so that they will show as search results when the search input field is interacted with.
The standard Blocs page settings, keywords, and the SEO page name values are used as search tags for each page. This makes the process of setting up search even quicker, as these values are most likely already populated in your project file.
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 onto the target page dynamic content area. This will tell Blocs not to index the page as part of the site search.
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.
External Link Bric
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 in your website and populate it via the sidebar controls with the external links you would like to include as part of your site's search.
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 server. Once your site is hosted, the search functionality will work as expected.
I was very excited to incorporate this functionality into one of my websites, BlocsTemplates.com, which has already more than 50 templates for Blocs so having a search on the site, will definitely help people find the template they need.
This Bric makes me excited to think about other cool features we could see in Blocs thanks to the release of Blocs.Store.