Skip to content

backwoodsman/tableshow

Repository files navigation

Plugin tag for CMSMadeSimple by richard <richard@the-place.net>.  It is
intended to extract and display a table presented in a simple wiki-like markup
in either a page or a global block.  Each line is interpreted as a table row
and can  have an optional '<br />' at the end to allow easy viewing for admin
purposes, but the recommended method is to enclose the whole block in <pre></pre>
tags.  Additionally, lines can be selected for display based on the values
in particular cells.  This allows, for example, the discarding of table rows
representing data for already passed dates, and the limiting of the distance
into the future for which data is shown.  When a partial table is shown, the 
relevant subheading can be preserved even if some rows after it are discarded.

USAGE: {tableshow [block="{bn}"|page="{pn}"] [start="{s-crit}"] 
        [end="{e-crit}"] [dateformat="{df}"] [replace="{rs}"] }

where
  {bn} or {pn} is global content block name, or page alias where the 
                   table data are given. Defaults to page alias = showtable.
                   It is recommended to enclose the data in <pre></pre> tags
                   to allow viewing.  These tags are automatically stripped.

  {s-crit} is the criterion for the starting row of the table given as
                   a column number (first column is '1') and
                   optional comparison eg: "3 > 1945". s-crit cell number
                   with no comparison defaults to >= today's date.

  {e-crit} is the criterion for the end row, similarly.

  {df} is a pipe-separated list of: a format string, and one or more column numbers.

  {rs} one or more pairs of strings, eg replace="aa|bbb||cc|ddd", which will cause
                   all instances of aa to be replaced by bbb and all instances of 
				   cc by ddd.  Intended for use on local currency symbols (eg:
				   "£|&pound;"), but can be used for arbitrary strings.

I have not implemented paging because inserting <thead> and <tfoot> 
segments should result in the browser dealing with paging.  These can be 
inserted directly into the source page or the three segments divided by
lines beginning with three or more hyphens ('---').  The segments must be 
in the order thead, tbody, tfoot, and the tfoot may be omitted.

Formatting of the table is controlled by css.

About

CMSmadesimple plugin displays table from wiki-like markup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages