Recommend this page to a friend! |
Classes of fathurrahman | mnTemplate | public/asset/vendor/select2/docs/plugins/simplesearch/README.md | Download |
|
DownloadGrav SimpleSearch Plugin
InstallationInstalling the SimpleSearch plugin can be done in one of two ways. Our GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file. GPM Installation (Preferred)The simplest way to install this plugin is via the Grav Package Manager (GPM) through your system's Terminal (also called the command line). From the root of your Grav install type:
This will install the SimpleSearch plugin into your Manual InstallationTo install this plugin, just download the zip version of this repository and unzip it under You should now have all the plugin files under
> NOTE: This plugin is a modular component for Grav which requires Grav, the Error and Problems plugins, and a theme to be installed in order to operate. Config OptionsTo effectively use the plugin, you first need to create an override config. To do so, create the folder
By creating the configuration file: > NOTE: If you want to search ALL PAGES just keep the To accomplish multiple search types in a single site, you should use page-based configuration. This is simple to do, simply provide any or all of the configuration options under a
These page headers will only be taken into account if the search route points to this page. For example: here the the route points to UsageThere are two approaches to using SimpleSearch. 1. Standalone Search PageThis is the traditional approach and involves having a searchbox 'somewhere' on your site. When you search you are shown a new page that displays the search results. On this page you will see a summary of the results and be able to click a link to visit each applicable page within your site. Think about how Google and other traditional search engines work. After installing the SimpleSearch plugin, you can add a simple searchbox to your site by including the provided twig template. Or copy it from the plugin to your theme and customize it as you please:
By default the simplesearch_searchbox Twig template uses the
The plugin actively looks for URLs requested that match the configured With this approach, the filters control which pages are searched. You can have multiple taxonomy filters here, and can configure the combinator to require any match (via You can also completely customize the look and feel of the results by overriding the template. There are two methods to do this.
2. Self-Controlled Search PageThis is a new feature of SimpleSearch and it very useful and simple way to provide a 'filter' like search of a collection listing page. In this example, we will assume you have a Blog listing page you wish to be able to search and filter based on a search box. To accomplish this, you need ot use the page-based configuration as described above, and configure multiple filters,
This will mean the search will only search pages that this page already is using for the collection. The Items could be anything the page collections support: For further help with the Multiple filters can be provided, and in order to search in the page's Tag field you would add The only thing needed to provide this functionality is a search box that points to the current page and appends the PerformanceSimple search is not a full-fledged index-powered search engine. It merely iterates over the pages and searches the content and title for matching strings. That's it. This is not going to result in screaming fast searches if your site has lots of content. One way to optimize things a little is to change the Searching TaxonomyBy default SimpleSearch will search in the Title, Content, and Taxonomy. All taxonomy will be searched unless you provide a taxonomy filter either in the page, or in the global plugin configuration:
This will ensure that only tag taxonomy types will be searched for the query.
Will ensure that both tag and author taxonomy types are searched. As all taxonomy types are searched by default, in order to stop searching into taxonomies completely simply set the filter to false:
Ignoring accented charactersYou can tell Simplesearch to return a positive value when searching for characters that have an accent. So To do so, enable _Ignore accented characters_ in Admin, or manually set UpdatingAs development for SimpleSearch continues, new versions may become available that add additional features and functionality, improve compatibility with newer Grav releases, and generally provide a better user experience. Updating SimpleSearch is easy, and can be done through Grav's GPM system, as well as manually. GPM Update (Preferred)The simplest way to update this plugin is via the Grav Package Manager (GPM). You can do this with this by navigating to the root directory of your Grav install using your system's Terminal (also called command line) and typing the following:
This command will check your Grav install to see if your SimpleSearch plugin is due for an update. If a newer release is found, you will be asked whether or not you wish to update. To continue, type > Note: Any changes you have made to any of the files listed under this directory will also be removed and replaced by the new set. Any files located elsewhere (for example a YAML settings file placed in [taxonomy]: http://learn.getgrav.org/content/taxonomy [headers]: http://learn.getgrav.org/content/headers [grav]: http://github.com/getgrav/grav [simplesearch]: simplesearch.yaml [results]: templates/simplesearch_results.html.twig |