RenderTopicsOfType
Display a table of topcis of a given type

02 May 2019 - 09:27 | Version 1 |

Documentation

Parameters
  • TYPE: the TopicType to be searched for, defaults to BASETOPIC
  • FIELDS: columns of formfields to display, defaults to TopicTitle, Summary, WikiApplication, Changed
  • SORT: sorting of rows, defaults to "Changed"
  • REVERSE: sorting direction, defaults to "off", defaults to "on" if SORT="Changed"
  • ROWS: number of rows to display initially, defauts to 10
  • FILTER: additional filter expression (optional)
  • THEWEB: web to examin, defaults to BASEWEB
  • ROWNUMBERS: boolean toggle to switch on/off row numbers
  • SELECTING: boolean toggle to switch on/off row selection, defaults to off
  • SEARCHMODE: either have one single search box using global or one per column using multi, default global
  • <field_name>_title: column title for the given field
  • <field_name>_width: column width for the given field

Implementation

Using JQDataTablesPlugin

%STARTINCLUDE%<noautolink>
%DATATABLE{
  class="foswikiFlatTable foswikiStripes"
  query="TopicType=~'\b%TYPE{default="%BASETOPIC%"}%\b' %IF{"defined FILTER" then="AND %FILTER%"}%" 
  web="%THEWEB{default="%BASEWEB%"}%"
  topic="%BASEWEB%.%BASETOPIC%"
  columns="%IF{"'%ROWNUMBERS{default="on"}%'='on'" then="index,"}%%FIELDS{default="TopicTitle,Summary,WikiApplication,Changed"}%" 
  rows="%ROWS{default="10"}%"
  filterbar="on" 
  toolbar="on" 
  sort="%SORT{default="Changed"}%"
  reverse="%REVERSE{default="%IF{"'%SORT{default="Changed"}%'='Changed'" then="on" else="off"}%"}%" 
  paging="on" 
  savestate="on"
  searching="on"
  searchmode="%SEARCHMODE{default="global"}%"
  width="100%"
  info="on"
  ordering="on"
  lengthmenu="5,10,20,30,50,100"
  WikiApplication_title="%TRANSLATE{"Application"}%"
  TopicTitle_title="%TRANSLATE{"Title"}%"
  Summary_title="%TRANSLATE{"Summary"}%"
  Changed_title="%TRANSLATE{"Changed"}%"
  %FORMATLIST{"%FIELDS{default="TopicTitle,Summary,WikiApplication,Changed"}%"
    split="\s*,\s*"
    format="$percntIF{\"defined $1_title\" 
              then=\"$1_title=\\"$percnt$1_title$percnt\\"\"
            }$percnt"
    separator="$n"
  }%
  %FORMATLIST{"%FIELDS{default="TopicTitle,Summary,WikiApplication,Changed"}%"
    split="\s*,\s*"
    format="$percntIF{\"defined $1_width\" 
              then=\"$1_width=\\"$percnt$1_width$percnt\\"\"
            }$percnt"
    separator="$n"
  }%
  %IF{"'%SELECTING{default="off"}%'='on'"
   then="selecting=\"on\" selectionmode=\"multi\" selectproperty=\"Topic\""
  }%
}%</noautolink>
%STOPINCLUDE%

Test

topic index TopicTitle Summary WikiApplication Changed

Calls to 'RenderTopicsOfType'

Copyright

© 2006-2019 Michael Daum http://michaeldaumconsulting.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 © 2002-2024 by contributors to Wasserstoff-Fahrer Forum ImpressumDatenschutz  Feedback
This website is using cookies. More info. That's Fine