From ce7a797c8ac387a3cbf3cbe423e53be64ff7c968 Mon Sep 17 00:00:00 2001 From: exu Date: Wed, 18 Sep 2024 11:47:19 +0200 Subject: [PATCH] Add tntsearch partial --- .../templates/partials/tntsearch.html.twig | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 themes/learn2-dark/templates/partials/tntsearch.html.twig diff --git a/themes/learn2-dark/templates/partials/tntsearch.html.twig b/themes/learn2-dark/templates/partials/tntsearch.html.twig new file mode 100644 index 0000000..77353e2 --- /dev/null +++ b/themes/learn2-dark/templates/partials/tntsearch.html.twig @@ -0,0 +1,30 @@ +{% set url = url|default(base_url|rtrim('/') ~ '/' ~ config.get('plugins.tntsearch.query_route', 's')|trim('/')) %} +{% set limit = limit|default(config.get('plugins.tntsearch.limit', 20)) %} +{% set snippet = snippet|default(config.get('plugins.tntsearch.snippet', 300)) %} +{% set min = min|default(config.get('plugins.tntsearch.min', 3)) %} +{% set search_type = search_type|default(config.get('plugins.tntsearch.search_type', 'auto')) %} +{% set placeholder = placeholder|default('Search...') %} +{% set live_update = in_page ? live_update|default(config.get('plugins.tntsearch.live_uri_update', 1)) : 0 %} +{% set nojs_action = config.get('plugins.tntsearch.search_route', '/search')|trim('/') %} + +{% set options = { uri: url, limit: limit, snippet: snippet, min: min, in_page: in_page, live_update: live_update, search_type: search_type } %} + +
+ {% block tntsearch_input %} + + {% endblock %} +
+ {% if tntsearch_results is defined and tntsearch_results is not empty and in_page %} + {% include 'tntquery-ajax.html.twig' %} + {% endif %} +
+ + {% if config.get('plugins.tntsearch.powered_by') %} +

+ {{ "PLUGIN_TNTSEARCH.POWERED_BY"|t("TNTSearch")|raw }} +

+ {% endif %} +
\ No newline at end of file