Function: RenderTableSearchResults

26 September 2022 - 23:08 | Version 5 |
Generic table display for search results

Documentation

TODO

Parameters
  • BASESEARCH - REQUIRED: Base search string (in DBCachePlugin DBQUERY format). For example: name = '.*' - e.g. finds all topics.
  • EXCLUDE - Option regex for results to exclude. Defaults to \bWeb* - e.g. excludes topics starting with "Web".
  • FACETS - Optional list of facets to use in the filter bar and search results.
  • INITSORT - Optionally set initial sort. Defaults to "modified".
  • INITLIMIT - Optionally set initial limit to # of results. Defaults to "all".
  • SEARCH_FORMAT - Optional setting for different format for search results.
  • HEADER_FORMAT - Optional setting for different format for search results header.
  • FOOTER_FORMAT - Optional setting for different format for search results footer.

Css

Implementation

%STARTINCLUDE%
<div class="jqDataTablesContainer" data-paginate="true" data-searching="true" data-info="true">
%TABLE{tablewidth="100%" columnwidths="250px,300px,50px,50px"}%
%~~   DBQUERY{
*~~       
%~~       DBCALL{"%TCAOWEB%.RenderSearchString"  
~~~           BASESEARCH="%IFDEFINED{"%BASESEARCH%" then="$test" else="name = '.*'" glue="off" }%" 
~~~           INITSORT="%IFDEFINED{"%INITSORT%" then="$test" else="modified" glue="off"}%"
~~~           INITLIMIT="%IFDEFINED{"%INITLIMIT%" then="$test" else="all" glue="off"}%" 
~~~           FACETS="%IFDEFINED{"%FACETS%" glue="off"}%"
~~~        }% 
~~~        web="%BASEWEB%" 
~~~        exclude="%IFDEFINED{"%EXCLUDE%" then="$test" else="\bWeb*" glue="off"}%" 
~~~        header="$percntIFDEFINED{\"%HEADER_FORMAT%\" 
~~~            then=\"%HEADER_FORMAT%\"
~~~            else=\"| *Topic* | *Summary* | *Modified by* | *On* |$n\"
~~~            glue=\"off\"}$percnt"
~~~        footer="$percntIFDEFINED{\"%FOOTER_FORMAT%\" 
~~~            then=\"%FOOTER_FORMAT%\"
~~~            else=\"\"  glue=\"off\"}$percnt"
~~~        format="
*~~            $percntIFDEFINEDTHEN{\"%SEARCH_FORMAT%\" glue=\"off\"}$percnt
~~~            %SEARCH_FORMAT%
~~~            $percntELSEDEFINED$percnt
*~~            | [[$web.$topic][$percntSPACEOUT{$topic}$percnt]] <span class=\"foswikiSmall\" ><em>
*~~                 $percntIFDEFINED{\"$expand(TopicType or Classification)\" 
~~~                       then=\"<noautolink>$expand(TopicType or Classification)</noautolink>\" glue=\"off\"}$percnt</em></span>  |
~~~                <noautolink>$formfield(Summary)</noautolink>   | 
~~~                $percntUSERSWEB$percnt.$expand(info.author) | $formatTime(info.date, '$day $month $year') |
~~~         $percntFIDEFINED$percnt"
~~~     }%
</div>
%JQREQUIRE{"datatables"}%
<!-- interrupt glue -->
%STOPINCLUDE%

Test

Calls to 'RenderTableSearchResults'

(C) 2006 LynnwoodBrown@Skyloom.com

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For more details read the LICENSE.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Middle Fork Home Wiki? Send feedback
Syndicate this site RSS