DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:structcondstyle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:structcondstyle [2022-06-02 09:38] – [structcondstyle Plugin] 2a02:8071:2ca4:9d00::4cc4plugin:structcondstyle [2024-07-25 14:40] (current) – unnecessary "the" deleted benks
Line 11: Line 11:
 conflicts  conflicts 
 similar    : structrowcolor similar    : structrowcolor
-tags       : color, struct, data, strata, conditional, style, css, table, aggregation+tags       : color, struct, data, strata, conditional, style, css, tables, aggregation
  
 downloadurl: https://github.com/larsOhne/structcondstyle/zipball/main downloadurl: https://github.com/larsOhne/structcondstyle/zipball/main
-bugtracker : http://github.com/larsOhne/structcondstyle/issues +bugtracker : https://github.com/larsOhne/structcondstyle/issues 
-sourcerepo : http://github.com/larsOhne/structcondstyle/+sourcerepo : https://github.com/larsOhne/structcondstyle/
 donationurl:  donationurl: 
  
Line 30: Line 30:
  
 ===== Syntax ===== ===== Syntax =====
-The plugin adds a new keyword to the definition of struct aggregations (see [[plugin:struct:aggregation|Struct Plugin: Aggregation]]), which allows the user to add a style to the rendered table, depending on specific column values. The syntax idea is simple: the keyword //condstyle:// is followed by a ternary operator, specifying the condition and the the styles related to the condition being true or false:+ 
 +The plugin adds a new keyword to the definition of struct aggregations (see [[plugin:struct:aggregation|Struct Plugin: Aggregation]]), which allows the user to add a style to the rendered table, depending on specific column values. The syntax idea is simple: the keyword //condstyle:// is followed by a ternary operator, specifying the condition and the styles related to the condition being true or false:
  
 Basic syntax: Basic syntax:
Line 40: Line 41:
 ---- ----
 </code> </code>
 +
 The conditional part (// COLUMN = ARGUMENT//) compares the current row's value in the //COLUMN// to the argument, using a (boolean) operator. If the condition is true, the //STYLE TRUE// will be applied to the row, otherwise the //STYLE FALSE// will be applied. The style are plain CSS code (multiple statements, each ended with a semicolon) and have to be allways wrapped within quotation marks.  The conditional part (// COLUMN = ARGUMENT//) compares the current row's value in the //COLUMN// to the argument, using a (boolean) operator. If the condition is true, the //STYLE TRUE// will be applied to the row, otherwise the //STYLE FALSE// will be applied. The style are plain CSS code (multiple statements, each ended with a semicolon) and have to be allways wrapped within quotation marks. 
 Currently, the following operators are recognized: Currently, the following operators are recognized:
 +
 ^ Operator  ^ Description                                                ^ Works for...          ^ ^ Operator  ^ Description                                                ^ Works for...          ^
-| =         | Row value has to be equal to the argument                  | text, dates, decimal +''%%=%%''         | Row value has to be equal to the argument                  | text, dates, decimal 
-| != / not  | Row value has to be not equal to the argument              | text, dates, decimal +''%%!=%%'' ''NOT''  | Row value has to be not equal to the argument              | text, dates, decimal 
-| <         | Row value has to be less than the argument                 | dates, decimal        | +''%%<%%''         | Row value has to be less than the argument                 | dates, decimal        | 
-| >         | Row value has to be greater than the argument              | dates, decimal        | +''%%>%%''         | Row value has to be greater than the argument              | dates, decimal        | 
-| < =        | Row value has to be less than or equal to the argument     | dates, decimal        | +''%%<=%%''        | Row value has to be less than or equal to the argument     | dates, decimal        | 
-| >=        | Row value has to be greater than or equal to the argument  | dates, decimal        | +''%%>=%%''        | Row value has to be greater than or equal to the argument  | dates, decimal        | 
-| contains  | Row value has to contain the argument                      | text, dates, decimal  |+''contains''  | Row value has to contain the argument                      | text, dates, decimal  |
  
 To adress the current date and time, the keyword //now// may be used as an argument. To adress the current date and time, the keyword //now// may be used as an argument.
  
 +//Example://
 +  condstyle  : cms-erl = critical change ? "color: red;" : "color:;"
  
  
 ===== Development ===== ===== Development =====
 +
 The pluging is actively maintained and improved. The pluging is actively maintained and improved.
  
 === Change Log === === Change Log ===
 +
 FIXME FIXME
  
 === ToDo/Wish List === === ToDo/Wish List ===
-FIXME+ 
 +This plugin uses the PHP mbstring extension which is rarely included by default.  There should at least be a note to this effect but it would be better if it didn't use it at all.  Many Dokuwiki users won't be able to add extensions to the PHP they are using.
  
 ===== FAQ ===== ===== FAQ =====
Line 71: Line 79:
  
 //nothing yet// //nothing yet//
- 
  
  
plugin/structcondstyle.1654155536.txt.gz · Last modified: 2022-06-02 09:38 by 2a02:8071:2ca4:9d00::4cc4

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki