templates/content/search.html.twig line 1

Open in your IDE?
  1. {% extends "base.html.twig" %}
  2. {% block body %}
  3. {% embed "1-col-sidebar.html.twig" %}
  4. {% block column %}
  5.     {% if total %}
  6.         <div class="paging float-right">
  7.             <div class="input-group">
  8.                 <div class="input-group-prepend px-3">
  9.                     <span>
  10.                     Showing: 
  11.                     {{ (page-1) * limit + 1 }} - 
  12.                 
  13.                     {% if ((page-1) * limit + limit <= total) %}
  14.                         {{ (page-1) * limit + limit }}
  15.                     {% else %}
  16.                         {{ total }}
  17.                     {% endif %}
  18.                     
  19.                     of 
  20.                     
  21.                     {{ total }}
  22.                     </span>
  23.                 </div>
  24.                 <div class="button-group input-group-append">
  25.                     {% if ((page-1)) %}
  26.                     <a 
  27.                         class="btn btn-secondary paging"
  28.                         type="submit"
  29.                         href="/search/{{ page-1 }}?s={{ search }}"
  30.                     ><i class="fa fa-angle-left"></i></a>
  31.                     {% endif %}
  32.                     {% if (page-1) * limit + limit < total %}
  33.                     <a 
  34.                         class="btn btn-secondary paging"
  35.                         type="submit"
  36.                         href="/search/{{ page+1 }}?s={{ search }}"
  37.                     ><i class="fa fa-angle-right"></i></a>
  38.                     {% endif %}
  39.                 </div>
  40.             </div>
  41.         </div>
  42.     {% endif %}
  43.     
  44.     <h1 class="mb-3">Search Results</h1>
  45.     <hr />
  46.     {% if total == 0 %}
  47.         <h6>No results found</h6>
  48.     {% endif %}
  49.     {% for result in results %}
  50.         <div class="row mb-3">
  51.             {% if result.getFeaturedImageTag() %}
  52.                 <div class="col-md-4"> 
  53.                     {{ result.getFeaturedImageTag("","")|raw }}
  54.                 </div>
  55.                 <div class="col-md-8">
  56.             {% else %}
  57.                 <div class="col-md-12">
  58.             {% endif %}
  59.             
  60.                 <h3 class="">
  61.                     <a href="{{ result.getUrl() }}">
  62.                         {{ result.getTypeText() }}: {{ result.getTitle() }}
  63.                     </a>
  64.                 </h3>
  65.                 <p class="post-byline"><strong>
  66.                     {{ result.getPublishedAt() | date | rcsDateFormat }}
  67.                 </strong></p>
  68.                 {% if result.getIntroText() %}
  69.                     <div class="intro">
  70.                         {{ result.getIntroText()|raw }}
  71.                         <strong><a href="{{ result.getUrl() }}">Read More {#<i class="fa fa-angle-double-right"></i>#}</a></strong>
  72.                     </div>
  73.                 {% endif %}
  74.                 
  75.             </div>
  76.         </div>
  77.         <hr />
  78.     {% endfor %}
  79.     
  80.     <div class="row">
  81.         <div class="col-md-12 mt-3">
  82.             {% if total %}
  83.                 <div class="paging float-right">
  84.                     <div class="input-group">
  85.                         <div class="input-group-prepend px-3">
  86.                             <span>
  87.                             Showing: 
  88.                             {{ (page-1) * limit + 1 }} - 
  89.                         
  90.                             {% if ((page-1) * limit + limit <= total) %}
  91.                                 {{ (page-1) * limit + limit }}
  92.                             {% else %}
  93.                                 {{ total }}
  94.                             {% endif %}
  95.                             
  96.                             of 
  97.                             
  98.                             {{ total }}
  99.                             </span>
  100.                         </div>
  101.                         <div class="button-group input-group-append">
  102.                             {% if ((page-1)) %}
  103.                             <a 
  104.                                 class="btn btn-secondary paging"
  105.                                 type="submit"
  106.                                 href="/search/{{ page-1 }}?s={{ search }}"
  107.                             ><i class="fa fa-angle-left"></i></a>
  108.                             {% endif %}
  109.                             {% if (page-1) * limit + limit < total %}
  110.                             <a 
  111.                                 class="btn btn-secondary paging"
  112.                                 type="submit"
  113.                                 href="/search/{{ page+1 }}?s={{ search }}"
  114.                             ><i class="fa fa-angle-right"></i></a>
  115.                             {% endif %}
  116.                         </div>
  117.                     </div>
  118.                 </div>
  119.             {% endif %}
  120.         </div>
  121.     </div>
  122. {% endblock %}
  123. {% block sidebar %}
  124.     {% include "includes/sidebar.html.twig" %}
  125. {% endblock %}
  126. {% endembed %}
  127. {% endblock %}