help text in sidebar
authorChristian Weiske <cweiske@cweiske.de>
Thu, 24 Nov 2016 21:38:56 +0000 (22:38 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 24 Nov 2016 21:38:56 +0000 (22:38 +0100)
data/config.php.dist
data/templates/search/sidebar-searchtips-chat.htm [new file with mode: 0644]
data/templates/search/sidebar-searchtips.htm [new file with mode: 0644]
data/templates/search/sidebar.htm
www/index.php

index 5c3eba8f09af0edae6df4ef49a91fa4040edaeb7..9bd10e4a6d3eb3ff423cef61811aafcb6822c10c 100644 (file)
@@ -30,6 +30,8 @@ $GLOBALS['phinde'] = array(
     'showFullContent' => false,
     //search result "hit" template file
     'hitTemplate' => 'hit.htm',
+    //sidebar help text. empty to disable
+    'sidebarinclude' => 'search/sidebar-searchtips.htm',
     //default sort order: "score" or "date"
     'defaultSort' => 'score',
     //database for PuSH subscriptions
diff --git a/data/templates/search/sidebar-searchtips-chat.htm b/data/templates/search/sidebar-searchtips-chat.htm
new file mode 100644 (file)
index 0000000..2cce73a
--- /dev/null
@@ -0,0 +1,23 @@
+<hr/>
+<h4>Search tips</h4>
+<dl>
+ <dt>Exclusion</dt>
+ <dd><tt>+foo -bar</tt></dd>
+
+ <dt>Logical OR</dt>
+ <dd><tt>foo OR bar</tt></dd>
+
+ <dt>Exact phrase</dt>
+ <dd><tt>"foo bar"</tt></dd>
+
+  <dt>Partial words</dt>
+  <dd><tt>foo*</tt></dd>
+
+  <dt>Particular fields only</dt>
+  <dd><tt>title:foo</tt></dd>
+  <dd><tt>domain:example.org</tt></dd>
+  <dd><tt>nick:somebody</tt></dd>
+  <dd><tt>after:2016-11-23</tt></dd>
+  <dd><tt>before:2016-11-23</tt></dd>
+  <dd><tt>date:2016-11-23</tt></dd>
+</dl>
diff --git a/data/templates/search/sidebar-searchtips.htm b/data/templates/search/sidebar-searchtips.htm
new file mode 100644 (file)
index 0000000..f703d44
--- /dev/null
@@ -0,0 +1,23 @@
+<hr/>
+<h4>Search tips</h4>
+<dl>
+ <dt>Exclusion</dt>
+ <dd><tt>+foo -bar</tt></dd>
+
+ <dt>Logical OR</dt>
+ <dd><tt>foo OR bar</tt></dd>
+
+ <dt>Exact phrase</dt>
+ <dd><tt>"foo bar"</tt></dd>
+
+  <dt>Partial words</dt>
+  <dd><tt>foo*</tt></dd>
+
+  <dt>Particular fields only</dt>
+  <dd><tt>title:foo</tt></dd>
+  <dd><tt>domain:example.org</tt></dd>
+  <dd><tt>author.name:Snowden</tt></dd>
+  <dd><tt>after:2016-11-23</tt></dd>
+  <dd><tt>before:2016-11-23</tt></dd>
+  <dd><tt>date:2016-11-23</tt></dd>
+</dl>
index 0c663ee4418c2be190d02634185b43a18728ccc9..9247f36889d97ba42a0a6dab8114383160af3bfb 100644 (file)
@@ -23,3 +23,7 @@
 <p class="muted">
  Query took {{queryTime}}.
 </p>
+
+{% if sidebarinclude %}
+  {% include sidebarinclude %}
+{% endif %}
index 8bd900ca90f403889957547cbd223bc14c5e0efe..33adfb0ac6a20ed04ed6c635f7fe9c284ef1a10a 100644 (file)
@@ -175,6 +175,7 @@ render(
         'sort' => $sort,
         'urlSorts' => $urlSorts,
         'hitTemplate' => 'search/' . $GLOBALS['phinde']['hitTemplate'],
+        'sidebarinclude' => $GLOBALS['phinde']['sidebarinclude'],
     )
 );
 ?>