lekoala / silverstripe-simple-search
Simple website search in SilverStripe
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
- php: >=7.2
- silverstripe/cms: ^4
Requires (Dev)
- silverstripe/googlesitemaps: ^2.1
- sminnee/phpunit: ^5.7
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-11-19 17:21:36 UTC
README
Intro
This module allows to implement a simple search engine for a website.
All searches are directed to a single endpoint: /search/ which is registered in the SiteMap if you use silverstripe/googlesitemaps
.
You can call $SimpleSearchForm
in your layout to output a form or create your own : simple point to /search/?q=YourQueryHere.
The search controller will search existing pages and DataObjects available in the sitemap.
Rendering the layout is up to you, but sample templates based on Bootstrap 5 are available in the /templates folder. We use the default
Page_results.ss
layout.
Searching DataObjects
By default, this module will also search any DataObject registered in the sitemap.
GoogleSitemap::register_dataobject(BlogTag::class); GoogleSitemap::register_dataobject(BlogCategory::class);
Will by default enable search on these objects.
Misc
- Please note with use ending / at the end of the url
- Implement custom filters in your dataobjects with getSearchFilters
Compatibility
Tested with 4.6 but should work on any ^4 projects
Maintainer
LeKoala - thomas@lekoala.be