some styling, noindex for search result pages
authorChristian Weiske <cweiske@cweiske.de>
Wed, 10 Feb 2016 14:14:34 +0000 (15:14 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 10 Feb 2016 14:14:34 +0000 (15:14 +0100)
data/templates/base.htm
data/templates/search.htm
data/templates/search/list.htm
www/www-header.php

index 72a34c1466d6c1251696fe75034ab6a9a73b798a..f54cd0cf9d909f3adbf9af417fbc285942112d42 100644 (file)
@@ -3,7 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <meta charset="utf-8" />
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <meta charset="utf-8" />
-  <title>{% block title %}{% endblock %} - {{title}}</title>
+  <title>{% block title %}{% endblock %}{{apptitle}}</title>
   <link rel="stylesheet" href="css/bootstrap.min.css"/>
   <link rel="stylesheet" href="css/font-awesome.css"/>
   <link rel="stylesheet" href="css/phinde.css"/>
   <link rel="stylesheet" href="css/bootstrap.min.css"/>
   <link rel="stylesheet" href="css/font-awesome.css"/>
   <link rel="stylesheet" href="css/phinde.css"/>
index d7037847867da7dc5475aea641b589506272d47a..c7b1bb7c5420b4c3a4950fe9288428c4f2e4e6e7 100644 (file)
@@ -1,6 +1,16 @@
 {% extends "base.htm" %}
 
 {% extends "base.htm" %}
 
-{%block title %}"{{query}}" search results{% endblock %}
+{% block meta %}
+ {% if query %}
+ <meta name="robots" value="noindex,nofollow"/>
+ {% endif %}
+{% endblock %}
+
+{%block title %}
+ {% if query %}
+ "{{query}}" search results -
+ {% endif %}
+{% endblock %}
 
 {% block maincontent %}
   <div class="navbar navbar-inverse navbar-static-top">
 
 {% block maincontent %}
   <div class="navbar navbar-inverse navbar-static-top">
   </div>
   <div class="container">
    <div class="row">
   </div>
   <div class="container">
    <div class="row">
+    {% if query %}
     <div class="span9">
      {% include 'search/list.htm' %}
     </div>
     <div class="span3">
      {% include 'search/sidebar.htm' %}
     </div>
     <div class="span9">
      {% include 'search/list.htm' %}
     </div>
     <div class="span3">
      {% include 'search/sidebar.htm' %}
     </div>
+    {% else %}
+    <div class="span3"></div>
+    <div class="span6">
+     <div class="hero-unit">
+      <h2>Hi!</h2>
+      <p>
+       Type something in the text box above to search ⬆
+      </p>
+     </div>
+    </div>
+    {% endif %}
    </div>
   </div>
 {% endblock %}
    </div>
   </div>
 {% endblock %}
index 069dcf3fce3714c07b9101406feba5644423026b..c034dc2f0a8a6b66a3de3c42520f689fcfe02c51 100644 (file)
@@ -1,5 +1,5 @@
 {% if hitcount == 0 %}
 {% if hitcount == 0 %}
- <p>
+ <div style="text-align: center; margin-top: 5ex; margin-bottom: 5ex">
   No results
   for "<strong><tt>{{cleanQuery}}</tt></strong>"
   {% if site %}
   No results
   for "<strong><tt>{{cleanQuery}}</tt></strong>"
   {% if site %}
@@ -7,7 +7,7 @@
   &#160;&#160;&#160;|&#160;&#160;&#160;
   <a href="{{urlNoSite}}">Show all results</a>
   {% endif %}
   &#160;&#160;&#160;|&#160;&#160;&#160;
   <a href="{{urlNoSite}}">Show all results</a>
   {% endif %}
- </p>
+ </div>
 {% else %}
 <p class="resultinfo">
   {{hitcount}}
 {% else %}
 <p class="resultinfo">
   {{hitcount}}
index 2ec8c2fffcc876e464247031af340f88ab0aeb9c..da0d74cd8cf60a3187b008707b6065147eff7bc8 100644 (file)
@@ -27,6 +27,7 @@ function render($tplname, $vars = array(), $return = false)
         //$vars['htmlhelper'] = new HtmlHelper();
     }
     $vars['apptitle'] = 'cweiske.de search';
         //$vars['htmlhelper'] = new HtmlHelper();
     }
     $vars['apptitle'] = 'cweiske.de search';
+    $vars['baseurl'] = '/';
 
     $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
     if ($return) {
 
     $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
     if ($return) {