Please enable JavaScript to view this site.

iService Forms User Guide

You can generate a list of find answers articles based on their topic, or based on the results of a keyword search. When generating the results from a keyword search,  you use the -PsearchID parameter as shown below.

 

<div>

   <form method="POST" enctype="multipart/form-data">

      $if -fieldregex'topicID'='$^'$

    <input type="hidden" name="topicID" id="topicID" value="1" />

 $endif$

//The section below provides an input box to type a search term//

    <input name="search" id="search" value="$form -id'search'$" />

         <input type="image" id="ok" name="ok" src="http://www.1to1service.com/images/iServiceCRM/searchButton.png" value="Go" />

    $if -fieldregex'search'='$ *^'$

     <br />

    $else$

    <p>Search Results:</p>

//The $if statement below means "If there are results from the search, then execute the repeat//

         $if -articlelist(search) -Psearchid'search' -Ptopic'topicID' -Ppagenum'1' -Pperpage'100' -Psort'DATE_REVERSE'$

//The value 'search' within -Psearchid above and below is a reference to the name of the input field above that captures the search terms//

            <table>

               <tr><th>Subject</th><th>Date</th><th>Rating</th><th>Viewed</th><th>Topic</th></tr>

               $repeat -articlelist(search) -Psearchid'search' -Ptopic'topicID' -Ppagenum'1' -Pperpage'100' -Psort'DATE_REVERSE'$

               <tr>

                   <td>$value -articlelist(subject)$</td>

                   <td>$value -articlelist(date)$</td>

                   <td>$value -articlelist(rating)$</td>

                   <td>$value -articlelist(viewcount)$</td>

                   <td>$value -articlelist(topicname)$</td></tr>

               $endrepeat$

            </table>

          $else$

            <p>There are no articles.</p>

          $endif$

        $endif$  

    </form>

</div>