Search Results App Page - Using App Information

This example uses app information for each search result to show an image next to each search result item.

{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>
      {if #result.app == 'page'}
        <img src="/images/documentation/icons/blog_blue.png" height="16" width="16" alt="Page" />
      {elseif #result.app == 'blog'}
        <img src="/images/documentation/icons/blog.png" height="16" width="16" alt="Blog" />
      {elseif #result.app == 'calendar'}
        <img src="/images/documentation/icons/calendar_month.png" height="16" width="16" alt="Calendar" />
      {elseif #result.app == 'document'}
        {if #result.appData.fileExtension}
          {#ext|set value="{#result.appData.fileExtension}"}
          {if #ext = 'doc' || #ext = 'docx'}
            <img src="/images/documentation/icons/document_word.png" height="16" width="16" alt="Word" />
          {elseif #ext = 'pdf'}
            <img src="/images/documentation/icons/document_pdf.png" height="16" width="16" alt="PDF" />
          {elseif #ext = 'xls' || #ext = 'xlsx'}
            <img src="/images/documentation/icons/document_excel.png" height="16" width="16" alt="Excel" />
          {elseif #ext = 'ppt' || #ext = 'pptx'}
            <img src="/images/documentation/icons/document_powerpoint.png" height="16" width="16" alt="Powerpoint" />
          {elseif #ext = 'csv'}
            <img src="/images/documentation/icons/document_excel_csv.png" height="16" width="16" alt="CSV" />
          {else}
            <img src="/images/documentation/icons/document.png" height="16" width="16" alt="Document" />
          {/if}
        {else}
          <img src="/images/documentation/icons/document.png" height="16" width="16" alt="Document" />
        {/if}
      {elseif #result.app == 'forum'}
        <img src="/images/documentation/icons/sort.png" height="16" width="16" alt="Forum" />
      {elseif #result.app == 'news'}
        <img src="/images/documentation/icons/newspaper.png" height="16" width="16" alt="News" />
      {/if}
      <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}