Search Results App Page - Simple Example

This is a simple example showing a basic search results page.

{if #totalItemCount > 0}
  <h3>{#firstItemNumber} - {#lastItemNumber} of {#totalItemCount}
  {if #totalItemCount > 1}
    results
  {else}
    result
  {endif}
  for "{#searchTerm}".
  </h3>

  {if count #resultsPerPageIntervals > 0}
    <p>
    {loop items="#resultsPerPageIntervals" key="key" value="interval"}
       {if #key > 0} | {/if}
       <a href="{#interval.url}">{#interval.number}</a>
    {/loop}
    </p>
  {/if}
  {loop items="#results" value="result"}
      <p>
      <a href="{#result.url}">{#result.title}</a><br />
      <span>{#result.publishDate}</span><br />
      {if #result.content}
        {#result.content}
      {/if}
      </p>
  {/loop}
 
  {if #pageCount > 1}
    {if #previousUrl}
      <a href="{#previousUrl}" title="Previous Page">&lt; Previous</a> |
    {/if}
    {loop items="#pagesInRange" value="page"}
      {if #page.number != #current}
        <a href="{#page.url}" title="Go to Page {#page.number}">{#page.number}</a>
      {else}
        <strong>{#page.number}</strong>
      {/if}
    {/loop}
    
    {if #nextUrl}
      | <a href="{#nextUrl}" title="Next Page">Next &gt;</a>
    {/if}
  {/if}

  {#form.content}  
{else}
  <p>There were no results for "{#searchTerm}".</p>
  <p>Search again</p>
  {#form.content}
{/if}