

[% # This is just an example -- you would want your own "page" for the wrapper %]

[% WRAPPER page %]

    [% PROCESS swish_header %]


    [% title = PROCESS title %]

    [% IF ! search.results %]
        [% PROCESS show_message %]
        [% PROCESS search_form %]

    [% ELSE %]
        [% PROCESS search_form %]
        [% PROCESS nav_bar %]
        [% PROCESS results_list %]
    [% END %]

    [% PROCESS swish_footer %]

[% END %]


[% # This is just an example -- you would want your own "page" to wrap around "swish" %]
[% BLOCK page %]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
   [% title || "Welcome"  %]
</title>
<body>
   [% content %]
</body>    
</html>    
[% END %]


[% BLOCK title %]
    [% IF ! search.results %]
        [% search.errstr || search.config('title') || "Search page" %]

    [% ELSE %]
        [% search.navigation('hits') %] Results for [[% search.query_simple | html %]]
    [% END %]
[% END %]

[% BLOCK swish_header %]    

    <table border="0" cellpadding="0" cellspacing="0">
    <tr><td>
        <a href="http://swish-e.org">
        <img border="0" alt="Swish-e home page" src="http://swish-e.org/Images/swish-e.gif"></a>
    </td><td valign="middle">
        <font size="+3">[% search.config('title') || "Search page"  %]</font>
    </td></tr>
    </table>

[% END %]    

[% BLOCK swish_footer %] 

    [% PROCESS nav_bar_pages2 %]
    <hr>
    <small>Powered by <em>Swish-e</em> <a href="http://swish-e.org">swish-e.org</a></small>
    [% IF search.MOD_PERL %]
        <br><small>Response brought to you by <a href="http://perl.apache.org"><em>mod_perl</em></a></small>
    [% END %]
  <p>
    <a href="http://validator.w3.org/check/referer"><img border="0"
        src="http://www.w3.org/Icons/valid-html401"
        alt="Valid HTML 4.01!" height="31" width="88"></a>
  </p>
[% END %]    



[% BLOCK show_message %]
    [% IF search.errstr %]
        <font size="+2" color="red">[% search.errstr | html %]</font>
    [% END %]
[% END %]



[% BLOCK search_form %]
    [% CGI.start_form( '-action' => CGI.script_name, '-method' => 'GET' ) %]
        [% CGI.textfield( {
            name    => 'query',
            size    => 40,
            maxlength => 200,
            } ) %]

        [% CGI.submit('submit','Search!') %]<br>
        [% search.get_meta_name_limits %]
        [% search.get_sort_select_list %]
        [% search.get_index_select_list %]
        [% search.get_limit_select %]
        [% search.get_date_ranges %]
        
    [% CGI.end_form.join('') %]

[% END %]


[% BLOCK nav_bar %]
    [% search.stopwords_removed %]
    <table cellpadding=0 cellspacing=0 border=0 width="100%">
        <tr>
            <td height=20 bgcolor="#FF9999">
                <font size="-1" face="Geneva, Arial, Helvetica, San-Serif">
                &nbsp;Results for <b>[% search.query_simple | html %]</b>
                &nbsp; [% search.navigation('from') %] to [% search.navigation('to') %] of [% search.navigation('hits') %] results.
                </font>
            </td>
            <td align=right bgcolor="#FF9999">
                <font size="-2" face="Geneva, Arial, Helvetica, San-Serif">
                Run time: [% search.navigation('run_time') %] |
                Search time: [% search.navigation('search_time') %] &nbsp; &nbsp;
                </font>
            </td>
        </tr>

        [% IF search.navigation('pages') %]

        <tr>
            <td colspan=2 bgcolor="#EEEEEE">
                [%# PROCESS nav_bar_pages %]
                [% PROCESS nav_bar_pages2 %]
            </td>
        </tr>
        [% END %]

    </table>
[% END %]

[% BLOCK nav_bar_pages %]                
    <font size="-1" face="Geneva, Arial, Helvetica, San-Serif">&nbsp;Page:</font>
    [% search.navigation('pages') %]

    [% IF search.navigation('prev_count') %]
        <a href="[% search.query_href %]&amp;start=[% search.navigation('prev') %]">
        Previous [% search.navigation('prev_count') %]</a>
    [% END %]

    [% IF search.navigation('next_count') %]
        <a href="[% search.query_href %]&amp;start=[% search.navigation('next') %]">
        Next [% search.navigation('next_count') %]</a>
    [% END %]
[% END %]

[%#
    Insead of pre-formatted numeric page links as above, you can use this
    example to generate the pages individually.
    For example, allows using images for page numbers.
%]

[% BLOCK nav_bar_pages2 %]
    &nbsp;

    [% IF search.navigation('prev_count') %]
        <a style="text-decoration:none" href="[% search.query_href %]&amp;start=[% search.navigation('prev') %]">&lt;&lt;</a>
    [% END %]


    [% FOR page = search.navigation('page_array') %]
        [% IF page.cur_page %]
            [[% page.page_number %]]
        [% ELSE %]
            <a style="text-decoration:none" href="[% search.query_href %];start=[% page.page_start %]">[% page.page_number %]</a>
        [% END %]
    [% END %]

    [% IF search.navigation('next_count') %]
        <a style="text-decoration:none" href="[% search.query_href %]&amp;start=[% search.navigation('next') %]">&gt;&gt;</a>
    [% END %]
[% END %]




[% BLOCK results_list %]
    [% FOREACH item = search.results %]
        <dl>
            <dt>
                [% item.swishreccount %]
                 <a href="[% item.swishdocpath_href %]">
                [% ( item.swishtitle || item.swishdocpath )  %]
                </a>

                <small>-- rank: <b>[% item.swishrank %]</b></small>
            </dt>

            <dd>
                [% item.swishdescription %]
                <br>
                <small>
                    [% item.swishdocpath %]
                    - [% item.swishdocsize %] bytes
                    - [% item.swishlastmodified %]
                </small>
            </dd>
        </dl>
    [% END %]
[% END %]
    

    

