From 4ca2d559e53d5a4e83710cecb75e96b0b76fd67a Mon Sep 17 00:00:00 2001 From: Pontus Horn Date: Fri, 8 Sep 2017 12:45:57 +0200 Subject: [PATCH] Clarify search results template instructions --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f6354d8..aa6599f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The search plugin should be executed before the pagination plugin (execution ord */ ``` * **Add a template file with the name defined in `search.md`.** - Your template file (`search.html` in the above example) should contain something like the following section, which + Your template file (`search.twig` in the above example) should contain something like the following section, which lists the pages matching the search (substitute `paged_pages` for `pages` if using Pico-Pagination): ```twig @@ -42,6 +42,20 @@ The search plugin should be executed before the pagination plugin (execution ord ``` + If you simply want to make your search results page look like your standard page, you may want to edit your theme's `index.twig` file and change `{{ content }}` to `{% block content %} {{ content }} {% endblock %}`. This allows you to extend this base template and reuse all the other parts of it in your search results template: + + ```twig + {% extends "index.twig" %} + + {% block content %} + {{ parent() }} + +
+ +
+ {% endblock content %} + ``` + Now, you should be able to visit for example `yoursite.com/search/foobar` (adjust path accordingly if putting search.md in a sub-folder) and see the search results for "foobar" listed.