Liqiud basics
Modules
API
Mailer
Search
Overview
Below you can see all the available drops on the search object
| Name | Description |
| search.articles | Returns an array of article drops |
| search.pages | Returns an array of page drop |
| search.files | Returns an array of media file drops |
| search.list_rows | Returns an array of list row drops |
| search.query | Returns the query that was searched for |
| search.edit_mode | Missing description |
| search.locale | Which locale the search is based on |
| search.articles_count | Returns the amount of articles matching the search quer |
| search.pages_count | Returns the amount of pages matching the search query |
| search.files_count | Returns the amount of files matching the search query |
| search.list_rows_count | Returns the amount of list rows matching the search query |
Form
When you want to add a search form to your page, you can use the following structure
<form action="/s" method="get">
<input type="text" name="q">
<button type="submit">Search</button>
</form>Template
The template to use when displaying search results is search.tpl. In that template you have access to all the properties on the search tag that you can see in the table above.
In the template you can access search results from articles, pages, files, and list rows.
Articles
{‰ for article in search.articles %}
{{ article.title }}
{% endfor %}
Pages
{‰ for page in search.pages %}
{{ page.title }}
{% endfor %}
Files
{‰ for file in search.files %}
<a href="{{ file.url }}">{{ file.pretty_name }}</a>
{% endfor %}
List rows
{‰ for row in search.list_rows %}
<a href="{{ row.url }}">{{ row.search_title }}</a>
{% endfor %}Updated: 2020-11-24