From bc5f4f5de46b2946cc48c90e499e0bfebdb11bfc Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 12 Jul 2017 18:41:30 +0200 Subject: [PATCH] Use right contentId to generate the article url in search template. As we do multisearch, we must use the associated contentID of the result to generate the url. --- src/searcher.cpp | 1 + static/results.tmpl | 78 ++++++++++++++++++++++++++++++++------------- 2 files changed, 56 insertions(+), 23 deletions(-) diff --git a/src/searcher.cpp b/src/searcher.cpp index 4966b7654..aae7a5267 100644 --- a/src/searcher.cpp +++ b/src/searcher.cpp @@ -314,6 +314,7 @@ string Searcher::getHtml() result["title"] = p_result->get_title(); result["url"] = p_result->get_url(); result["snippet"] = p_result->get_snippet(); + result["contentId"] = humanReaderNames[p_result->get_readerIndex()]; if (p_result->get_size() >= 0) { result["size"] = kiwix::beautifyInteger(p_result->get_size()); diff --git a/static/results.tmpl b/static/results.tmpl index 1d95b8012..88f2f9499 100644 --- a/static/results.tmpl +++ b/static/results.tmpl @@ -92,36 +92,68 @@ Search: <TMPL_var searchPattern> - - + +
- Results - of for No result were found for + + Results + + - + of + + for + + + + No result were found for +
-
- - + + +