SiteSearch Plugin for October CMS
This plugin adds global search capabilities to October CMS.
Available languages
- English
- German
- Czech
- Russian
- Persian (Farsi)
- Portuguese
You can translate all contents into your own language.
Currently supported content types (out-of-the-box)
- NEW! OFFLINE.Mall
- Graker.PhotoAlbums
- VojtaSvoboda.Brands
- RainLab.Pages
- RainLab.Blog
- Feegleweb.Octoshop
- Indikator.News
- Jiri.JKShop
- RadiantWeb.ProBlog
- Arrizalamin.Portfolio
- Responsiv.Showcase
- Native CMS pages (experimental)
You can also add support for your custom plugins.
Multilingual contents via RainLab.Translate are supported.
Support for more plugins is added upon request.
Get native support for your plugin
You can easily extend this plugin to search all your custom plugin's contents as well. See the documentation for further information.
If you are a plugin developer and wish to have native support for your contents in SiteSearch please submit a pull request for your search provider or send us a copy of you plugin so we can create the provider for you.
We cannot add support for every plugin but will add any plugin that has a notable project count on the October Marketplace.
Contributing
Translations, search providers, bug reports
Please submit pull requests with translations or search providers on the plugin's GitHub page. Bug reports and feature requests via Issues are welcome!
This plugin is also included into the following bundle
The following themes use this plugin

Vega Pro
Vega Pro
One page theme with Blog, Pages, Translations, Contact form and more

Altass
Altass
Minimal theme for OctoberCMS

Multipurpose Theme with PAGE BUILDER - Success
Multipurpose Theme with PAGE BUILDER - Success
Octobercms Multipurpose Theme with easy Page Builder system

Shopaholic Theme with PAGE BUILDER - Agora
Shopaholic Theme with PAGE BUILDER - Agora
Octobercms Ecommerce Theme with Powerful Eshop & Blog Capabilities and an easy Page Builder system.

Modular Theme with PAGE BUILDER - Clear
Modular Theme with PAGE BUILDER - Clear
Octobercms Multipurpose Theme with Powerful Settings and an easy CRUD Generator - Page Builder system

UI3kitify
UI3kitify
Based on UI3kit Starter development template for building UIkit v3 themed sites.

Mall Demo Theme
Mall Demo Theme
Official starter theme for the Mall e-commerce plugin

Ultimate Website Builder - CREATOR Theme Bundle
Ultimate Website Builder - CREATOR Theme Bundle
The Ultimate Octobercms Theme Bundle with Advanced Page Builder & Powerful Component Blocks

Purpose
Purpose
A multipurpose and contemporary flat design OctoberCMS theme with rich animations With Native Page Builder

Industry
Industry
Responsive Bootstrap 4 HTML5 Theme for Bootstrap 4 Page Builder Plugin

Montana
Montana
Bootstrap 4 HTML5 Responsive Hotel Booking Website Template

Ararat
Ararat
Bootstrap 4 HTML5 website template

Dizzi
Dizzi
Bootstrap 4 HTML5 Professional Business Website Template

Aavas
Aavas
Bootstrap 4 HTML5 Business Agency Website Template

eMarket - Advanced E-Commerce Octobercms theme
eMarket - Advanced E-Commerce Octobercms theme
Premium Ecommerce Octobercms theme based on OFFLINE Mall Plugin

Rapido
Rapido
Polished single-page business-oriented theme with a blog.

Bootstrap 5 Mall Starter
Bootstrap 5 Mall Starter
Unofficial Bootstrap 5 starter theme for the Mall e-commerce plugin, based on the original Mall Starter theme

Presence - Multipurpose Theme with Powerful Pagebuilder
Presence - Multipurpose Theme with Powerful Pagebuilder
An Excellent Octobercms Theme with Advanced Page Builder & Powerful Theme settings
Components
searchResults
Place this component on your page to display search results.
Usage example
Create a search form that sends a query to your search page:
Search form
<form action="{{ 'search' | page }}" method="get"> <input name="q" type="text" placeholder="What are you looking for?" autocomplete="off"> <button type="submit">Search</button> </form>
Important: Use the q
parameter to send the user's query.
Search results
Create a page to display your search results. Add the searchResults
component to it.
Use the searchResults.query
parameter to display the user's search query.
title = "Search results" url = "/search" layout = "default" is_hidden = 0 [searchResults] resultsPerPage = 10 showProviderBadge = 1 noResultsMessage = "Your search did not return any results." visitPageMessage = "Visit page" == <h2>Search results for {{ searchResults.query }}</h2> {% component 'searchResults' %}
Overwrite default markup
It is highly recommended you overwrite the default markup of the search results component. This way your layout won't break when the plugin's default markup changes in future releases.
To overwrite the default markup copy all files from plugins/offline/sitesearch/components/searchresults
to
themes/your-theme/partials/searchResults
and modify them as needed. The directory name is case sensitive.
[searchResults] // Place markup in /themes/your_theme/partials/searchResults resultsPerPage = 10
If you gave an alias to the searchResults
component make sure to put the markup in the appropriate partials directory.
[searchResults resultsAlias] // Place markup in /themes/your_theme/partials/resultsAlias resultsPerPage = 10
Example css to style the component
.ss-result { margin-bottom: 2em; } .ss-result__aside { float: right; margin-left: .5em; } .ss-result__title { font-weight: bold; margin-bottom: .5em; } .ss-result__badge { font-size: .7em; padding: .2em .5em; border-radius: 4px; margin-left: .75em; background: #eee; display: inline-block; } .ss-result__text { margin-bottom: .5em; } .ss-result__url { }
Modify the query before searching
If you want to modify the user's search query before the search is executed you can call the forceQuery
method on the searchResults
component from your page's onStart
method.
[searchResults] resultsPerPage = 10 showProviderBadge = 1 noResultsMessage = "Your search returned no results." visitPageMessage = "Visit page" == function onStart() { $query = Request::get('q'); $query = str_replace('Ñ‘', 'e', $query); $this->page->components['searchResults']->forceQuery($query); } == {% component 'searchResults' %}
Change the results collection before displaying
You can listen for the offline.sitesearch.results
event and modify the query as you wish.
This is useful to remove certain results or change the sort order.
[searchResults] resultsPerPage = 10 showProviderBadge = 1 noResultsMessage = "Your search returned no results." visitPageMessage = "Visit page" == function onInit() { \Event::listen('offline.sitesearch.results', function ($results) { // return $results->filter(...); return $results->sortByDesc('model.custom_attribute'); }); } == {% component 'searchResults' %}
Properties
The following properties are available to change the component's behaviour.
resultsPerPage
How many results to display on one page.
showProviderBadge
The search works by querying multiple providers (Pages, Blog, or other). If this option is enabled each search result is marked with a badge to show which provider returned the result.
This is useful if your site has many different entities (ex. teams, employees, pages, blog entries).
noResultsMessage
This message is shown if there are no results returned.
visitPageMessage
A link is placed below each search result. Use this property to change that link's text.
searchInput
Place this component anywhere you want to display a simple search input with "search as you type" capabilities.
Usage example
Add the searchInput
component to any layout, partial or page.
title = "Home" url = "/" ... [searchInput] useAutoComplete = 1 autoCompleteResultCount = 5 showProviderBadge = 1 searchPage = "search.htm" == {% component 'searchInput' %}
Example css to style the component
.ss-search-form { position: relative; } .ss-search-form__results { display: none; position: absolute; left: 0; top: 35px; width: 100%; background: #fff; padding: 1em; box-shadow: 0 2px 4px rgba(0, 0, 0, .1); } .ss-search-form__results--visible { display: block; }
Properties
The following properties are available to change the component's behaviour.
useAutoComplete
If this property is enabled, a search query will be executed as soon as the user begins to type.
autoCompleteResultCount
This many results will be displayed to the user below the input field. There will be a
"Show all results" link the user can click that takes her to a full search results page if one has
been specified via the searchPage
property.
showProviderBadge
The search works by querying multiple providers (Pages, Blog, or other). If this option is enabled each search result is marked with a badge to show which provider returned the result.
This is useful if your site has many different entities (ex. teams, employees, pages, blog entries).
searchPage
The filename of the page where you have placed a searchResults
component. If a user clicks on the "Show all
results" link it will take him to this page where a full search is run using the searchResults
component.
Add support for custom plugin contents
Simple method
To return search results for you own custom plugin, register an event listener for the offline.sitesearch.query
event in your plugin's boot method.
Return an array containing a provider
string and results
array. Each result must provide at least a title
key.
Example to search for custom documents
See Readme on GitHub
Advanced method
If you need a bit more flexibility you can also create your own ResultsProvider
class. Simply extend SiteSearch's
ResultProvider
and implement the needed methods. Have a look at the existing providers shipped by this plugin to get
an idea of all the possibilities.
When your own ResultsProvider
class is ready, register an event listener for the offline.sitesearch.extend
event in your plugin's boot method. There you can return one ResultsProvider
(or multiple in an array) which will
be included every time a user runs a search on your website.
Advanced example to search for custom documents
See Readme on GitHub
Settings
You can manage all of this plugin's settings in the October CMS backend.
Rainlab.Pages
No special configuration is required.
Rainlab.Blog
Make sure you select your CMS page with the blogPost
component as the blog post page
in the backend settings.
You can access a post's published_at date in your search results via {{ result.meta }}
.
Feegleweb.Octoshop
Make sure you set the Url of product detail page
setting to point to the right url. Only specify the fixed part of
the URL: /product
. If your products are located under /product/:slug
the default value is okay.
Jiri.JKShop
Make sure you set the Url of product detail page
setting to point to the right url. Only specify the fixed part of
the URL: /product
. If your products are located under /product/:slug
the default value is okay.
You can access an article's price in your search results via {{ result.meta }}
.
Indikator.News
Make sure you set the News post page
setting to point to the right url. Only specify the fixed part of
the URL: /news/post
. If your products are located under /news/post/:slug
the default value is okay.
RadiantWeb.ProBlog
Make sure you set the Url of blog post page
setting to point to the right url. Only specify the fixed part of
the URL: /blog
. If your posts are located under /blog/:category/:slug
the default value is okay.
ArrizalAmin.Portfolio
Make sure you set the Url of portfolio detail page
setting to point to the right url. Only specify the fixed part of
the URL: /portfolio/project
. If your detail page is located under /portfolio/project/:slug
the default value is okay.
VojtaSvoboda.Brands
Make sure you set the Url of brand detail page
setting to point to the right URL. Only specify the fixed part of the URL: /brand
. If your brand detail page is located under /brand/:slug
then insert only /brand
without the slug parameter.
CMS pages (experimental)
If you want to provide search results for CMS pages change the enabled
setting to On
.
You have to specifically add the component siteSearchInclude
to every CMS page you want to be searched.
Pages without this component will not be searched.
This feature works best with simple pages that include components, but don't rely on url parametres or other
variables (like a page number). CMS pages with dynamic URLs (like /page/:slug
) won't be linked correctly from the search results listing.
If you have CMS pages with more complex dynamic contents consider writing your own search provider (see Add support for custom plugin contents
)
-
Vitaliy
Found the plugin useful on 8 Nov, 2020
Hi! I like it, but how i can correct it? Size border and name button ?
-
Snipi
Found the plugin useful on 31 Jul, 2020
Great plugin.. Easy to use, understandable... Only one question / what about result grouping by provider? something like categories, etc.
-
Josh
Found the plugin useful on 26 Nov, 2019
Already know that this is going to be perfect for my use case!
Super nice creator too, helpful and understanding.
Would definitely recommend to anyone who wants an easy to use site wide search!
-
anwer ismail
Found the plugin useful on 21 Nov, 2019
hey there, thankx for this wonderful plugin, just I have an issue, I integrate the plugin with my own specific plugins and it works fine just the result of the search is not grouped correctly
-
OFFLINE author
Replied on 21 Nov, 2019
Thank you very much for your review. For support requests please use our GitHub issue tracker or October's support forum. Also, to be able to support you, please provide code samples and a specific use-case that is not working as you expect it.
Thanks!
-
Vladimir
Found the plugin useful on 21 Oct, 2019
Good plugin!
-
mesinrusak
Found the plugin useful on 8 May, 2019
This plugin is pretty awesome. but on the rainlab page, this plugin cannot search in content. I have a lot of static content that I want to include in the search results. Maybe you can solve this issue in next upgrade. Thank you
-
OFFLINE author
Replied on 8 May, 2019
Hi, thank you for your review!
The plugin already searches through RainLab.Pages contents, as you can check on our OFFLINE.Mall demo website: https://mall.offline.swiss/en/suche?q=duo+dolores+et+ea+reb
Maybe your setup isn't correct? Feel free to ask for support over on GitHub.
-
Matthew Guillot
Found the plugin useful on 5 Dec, 2017
I will repeat what others have already said. Brilliant plugin! The author is also responsive to support requests on the support forum, and helped me figure out a problem I was having getting the plugin to work. After a little back and forth with the author, it turned out to be my own configuration that was the problem. Thanks OFFLINE for your help and patience with me. The plugin works great!
-
Brian
Found the plugin useful on 7 Oct, 2017
Great plugin. Very extendable & works well with ProBlog. Love.
-
Kakulia Beso
Found the plugin useful on 24 May, 2017
First of all, thank you for this brilliant plugin. But i have a problem with images. It shows one image for all searched results, can you help me . TY
-
OFFLINE author
Replied on 24 May, 2017
Hi thanks for your review.
Please use our GitHub issues page for any kind of support requests.
-
Ayhan Eraslan
Found the plugin useful on 8 Mar, 2017
Category insertion failed MySQL Server version: 5.7.17-0ubuntu0.16.04.1 (Ubuntu)
"SQLSTATE[HY000]: General error: 1364 Field 'sort_order' doesn't have a default value (SQL: insert into `offline_snipcartshop_categories` (`name`, `slug`, `meta_title`, `meta_description`, `parent_id`, `nest_left`, `nest_right`, `updated_at`, `created_at`) values (Uncategorized, uncategorized, Uncategorized, , , 1, 2, 2017-03-08 20:07:20, 2017-03-08 20:07:20))" on line 662 of /var/www/html/seramik/vendor/laravel/framework/src/Illuminate/Database/Connection.php
-
OFFLINE author
Replied on 8 Mar, 2017
Hi Thanks for your review. I think you meant to review our SnipcartShop plugin, not this one. I have released a new version 1.0.6 to solve this problem. Another solution to work around this error is to turn off mysql strict mode for your installation.
-
Carlos
Found the plugin useful on 30 Dec, 2016
Hi is there a way to have auto-complete functionalities on this create plugin? Thanks Carl
-
OFFLINE author
Replied on 31 Dec, 2016
There is currently no support for autocomplete available. I have created an issue on github. Maybe we'll implement it in a future release. Thanks for your suggestion!
-
Waka Jeng
Found the plugin useful on 27 Nov, 2016
Pretty awesome.
-
Michael Reich
Found the plugin useful on 3 Jul, 2016
Very good plugin and superb support! Thank you very much!
-
Andy Woods
Found the plugin useful on 13 Feb, 2016
This plugin works brilliantly.
Great job - well done.
-
1.5.6 |
Updated russian translations (thanks to @Web-VPF) Mar 30, 2021 |
---|---|
1.5.5 |
Fixed handling of invalid offline.sitesearch.results event returns Dec 03, 2020 |
1.5.4 |
Fixed handling of invalid page url parameter Nov 29, 2020 |
1.5.3 |
Fixed result order in searchInput component Jun 17, 2020 |
1.5.2 |
Made Result::markQuery method public for easier extension Jun 17, 2020 |
1.5.1 |
Fixed typo in the newly added event name May 05, 2020 |
1.5.0 |
Added `offline.sitesearch.results` event to allow customization (filter, sort) of the results collection before it is displayed May 01, 2020 |
1.4.10 |
Improved Czech translations Apr 23, 2020 |
1.4.9 |
Moved query log link from main navbar to backend settings Apr 22, 2020 |
1.4.8 |
Allow custom penalty parameters in ResultsProvider::agePenaltyForDays method Apr 10, 2020 |
1.4.7 |
Optimized searchResults component so it can be used in partials and static pages Mar 11, 2020 |
1.4.6 |
Made getAgePenalty method static so it can be re-used in simple Event providers Feb 04, 2020 |
1.4.5 |
Use meta_title for RainLab.Pages results if available Oct 17, 2019 |
1.4.4 |
Optimized support for cms pages search: Your Twig markup is now completely rendered and searched! Oct 09, 2019 |
1.4.3 |
Fixed bug where empty queries resulted in an Exception Aug 14, 2019 |
1.4.2 |
Added User-Agent to list view Jul 31, 2019 |
1.4.1 |
Minor bugfixes Jul 31, 2019 |
1.4.0 |
SiteSearch can now log all search queries. Enable via backend settings. Jul 31, 2019 |
1.3.22 |
Fixed problem with queries that contain only spaces Jun 17, 2019 |
1.3.21 |
Fixed RainLab.Blog published_at date handling Apr 29, 2019 |
1.3.20 |
Added bulgarian translations (thank to @NGavanozov) Mar 18, 2019 |
1.3.19 |
Added finnish translations (thank to @mediaclinic) Mar 04, 2019 |
1.3.18 |
Updated persian translations (thanks to @sajjad-ser) Feb 19, 2019 |
1.3.17 |
Fixed pagination links when using RainLab.Translate Feb 18, 2019 |
1.3.16 |
Only search RainLab.Blog contents of current locale Feb 18, 2019 |
1.3.15 |
Catch invalid markup errors when searching RainLab.Pages Jan 29, 2019 |
1.3.14 |
Include placeholders on Rainlab.Pages pages in search results Jan 20, 2019 |
1.3.13 |
Pre-populate search query in searchInput field Dec 10, 2018 |
1.3.12 |
Stability improvements Dec 05, 2018 |
1.3.11 |
Trim query before searching Oct 30, 2018 |
1.3.10 |
Fixed link to search result in default results partial (thanks to wizzard94) Sep 25, 2018 |
1.3.9 |
Added Chinese language support (thanks to Ckend) Sep 16, 2018 |
1.3.8 |
Optimized support for multiple SearchInput components on a single page. Apr 16, 2018 |
1.3.7 |
Added the ability to add age penalties to search results. This can be used to show never results higher up in your search results. Mar 29, 2018 |
1.3.6 |
!!! Using RadiantWeb.ProBlog's internal settings to get the correct parent page for a blog post result. This enables support for multiple blogs on the same website. If your blog search results have wrong URLs after this update make sure to configure your default page for rendering blog posts via the ProBlog backend settings. Feb 17, 2018 |
1.3.5 |
Added ability to edit the user's query before searching Sep 19, 2017 |
1.3.4 |
Fixed undefined index error when a static page doesn't have a title set Sep 10, 2017 |
1.3.3 |
!!! All results are now returned with a relative URL to prevent problems with translated contents. Make sure to pass your result.url throught the "app" filter if you are using your own search result partials Sep 06, 2017 |
1.3.2 |
Fixed bug in AutoCompleteComponent Jul 06, 2017 |
1.3.1 |
Added new searchInput component with search-as-you-type feature Jun 27, 2017 |
1.2.33 |
Fix the use of multiple custom ResultsProvider for a plugin Jun 25, 2017 |
1.2.32 |
Added support for custom ResultsProvider classes Jun 24, 2017 |
1.2.31 |
Added model property for each search result to retreive the original model the result was generated from Jun 22, 2017 |
1.2.30 |
The searchResults component's resultsCollection is now publically accessible May 19, 2017 |
1.2.29 |
Optimized thumbnail generation for Graker.PhotoAlbums results (thanks to graker) May 13, 2017 |
1.2.28 |
Added new result.identifier property May 13, 2017 |
1.2.27 |
Added support for Graker.PhotoAlbums (thanks to graker) May 12, 2017 |
1.2.26 |
Exclude hidden static pages from search results (thanks to plyusninva) Apr 13, 2017 |
1.2.25 |
Fixed bug that sometimes lead to broken html in search results (thanks to graker) Mar 14, 2017 |
1.2.24 |
Added composer.json to allow loading plugin as dependency (thanks to adduc) Jan 03, 2017 |
1.2.23 |
Fixed support for translated Rainlab.Blog contents Dec 14, 2016 |
1.2.22 |
Fixed Portuguese translations Dec 14, 2016 |
1.2.21 |
Added Portuguese translations (thanks to ribsousa) Dec 14, 2016 |
1.2.20 |
Added support for VojtaSvoboda.Brands (thanks to vojtasvoboda) Dec 14, 2016 |
1.2.19 |
Added support for OFFLINE.SnipcartShop Dec 04, 2016 |
1.2.18 |
Fixed bug where titles of static pages where not searched (thanks to beenen445) Nov 15, 2016 |
1.2.17 |
Added support for Indikator.News (thanks to gergo85) Oct 28, 2016 |
1.2.16 |
Added Persian (Farsi) translations (thanks to cracki) Aug 28, 2016 |
1.2.15 |
Added a new meta property for search results (thanks to cracki) Aug 27, 2016 |
1.2.14 |
Fixed bug in Jiri.JKShop provider Aug 21, 2016 |
1.2.13 |
Minor bugfixes for marked queries in search results and Rainlab.Blog provider (Thanks to graker) Aug 07, 2016 |
1.2.12 |
Added support for Jiri.Jkshop Jul 24, 2016 |
1.2.11 |
Optimized handling of multibyte strings Jul 10, 2016 |
1.2.10 |
Added support for multiple variables in Rainlab.Blog urls (Thanks to graker) Jul 10, 2016 |
1.2.9 |
Added support for static page component hosts Jul 06, 2016 |
1.2.8 |
Added support for viewBag properties in RainLab.Pages Jul 05, 2016 |
1.2.7 |
Fixed bug where custom url settings were ignored in search results for some providers Jul 04, 2016 |
1.2.6 |
Added support for Responsiv.Showcase (Thanks to MichiReich) Jul 04, 2016 |
1.2.5 |
Fixed bug where the provider badge is not displayed for custom search providers Jun 29, 2016 |
1.2.4 |
Fixed bug where unavailable thumbnails lead to an error Jun 27, 2016 |
1.2.3 |
Fixed bug where the search results sometimes broke the page layout Jun 16, 2016 |
1.2.2 |
Minor bugfix in Feegleweb.Octoshop settings page translation May 31, 2016 |
1.2.1 |
Added support for Feegleweb.Octoshop (Thanks to billyzduke) May 27, 2016 |
1.1.3 |
Added ru_RU locale (Thanks to mokeev1995) May 24, 2016 |
1.1.2 |
Fixed backend permissions May 21, 2016 |
1.1.1 |
Added optimized siteSearchInclude component for cms pages search May 21, 2016 |
1.1.0 |
Added support for translated contents in RainLab.Pages, ArrizalAmin.Portfolio and RadiantWeb.ProBlog May 21, 2016 |
1.0.10 |
Removed unused component Apr 26, 2016 |
1.0.9 |
Added support for ArrizalAmin.Portfolio plugin Apr 21, 2016 |
1.0.8 |
Add cs_CZ locale (Thanks to vojtasvoboda) Apr 03, 2016 |
1.0.7 |
Add function for getting last page number (Thanks to vojtasvoboda) Mar 21, 2016 |
1.0.6 |
Fixed hardcoded url in pagination Feb 21, 2016 |
1.0.5 |
Moved configuration to the backend Feb 13, 2016 |
1.0.4 |
Added support for RadiantWeb.ProBlog Feb 13, 2016 |
1.0.3 |
Added missing component Feb 10, 2016 |
1.0.2 |
Added experimental CMS pages results provider Feb 09, 2016 |
1.0.1 |
First version of SiteSearch Jan 30, 2016 |
Upgrade to version 1.0.5
All configuration has been moved to the backend settings. If upgrading from a lower version don't forget to enter your configuration again via the backend.
Upgrade to version 1.3.3
If a plugin returned an absolute url (http://example.com/result
) for a result this will now be converted to a relative url (/result
) so make sure you are passing the result.url
through the app
filter in your partials.
This is to prevent problems with Rainlab.Translate where sometimes the language was present twice in the url when using the Force url scheme option
.
If you are using the default search result partials you don't need to change anything.
<p class="ss-result__url"> <a href="{{ result.url | app }}" class="ss-result__link">{{ __SELF__.visitPageMessage }} →</a> </p>