Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jesselau76/hugo-w3-simple.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjesselau76 <jesselau76@gmail.com>2018-11-11 02:25:48 +0300
committerjesselau76 <jesselau76@gmail.com>2018-11-11 02:25:48 +0300
commit3e317cc1d05d7e0711c31ed5638cc6c394014952 (patch)
tree1d64d6dbf9b1c6816f12f9c0ffe632054257c96d
parent3d063a1580246e7f2403947c5e6d565b634d3163 (diff)
no results info box
-rw-r--r--layouts/search/single.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/layouts/search/single.html b/layouts/search/single.html
index de77fd8..b96309e 100644
--- a/layouts/search/single.html
+++ b/layouts/search/single.html
@@ -64,6 +64,19 @@ function gosearch() {
<div id="searchresult" class="w3-content w3-card-4" >
{{ "<?php" | safeHTML }}
+ if (mysqli_num_rows($result)==0)
+ {
+ ?>
+ <div class="w3-panel w3-pale-yellow w3-display-container">
+ <span onclick="this.parentElement.style.display='none'"
+ class="w3-button w3-large w3-display-topright">&times;</span>
+ <h3>No Results!</h3>
+ <p>There are no posts about <b>{{ "<?php echo $q;?> " | safeHTML }}</b>. Please try another keywords.</p>
+ </div>
+ {{ "<?php" | safeHTML }}
+ }
+ else
+ {
foreach($result as $row)
{
?>
@@ -84,6 +97,7 @@ function gosearch() {
{{ "<?php" | safeHTML }}
}
+}
?>
</div>