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 [2020-12-27 23:55] – [structcondstyle Plugin] larsOhneplugin:structcondstyle [2024-03-04 09:56] (current) Aleksandr
Line 5: Line 5:
 author     : larsOhne  author     : larsOhne 
 email      : ohnemus.lars@gmail.com  email      : ohnemus.lars@gmail.com 
-type       : Action +type       : action, struct 
-lastupdate : 2020-12-27+lastupdate : 2022-06-02
 compatible : Hogfather compatible : Hogfather
 depends    : struct depends    : struct
 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 28: Line 28:
 Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-===== Examples/Usage ===== 
  
-//[Most people learn by example, so this goes first]//+===== Syntax =====
  
-See the plugin in action [[www.demosite.com|here]]. The sample page shows all the styles available with the plugin.+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:
  
-A simple box:+Basic syntax: 
 +<code> 
 +---- struct table---- 
 +schema: schema1 
 +cols: * 
 +condstyle: COLUMN NAME = ARGUMENT ? "STYLE TRUE" : "STYLE FALSE" 
 +---- 
 +</code>
  
-  <box> the box contents </box>+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:
  
-Some more complex boxes+^ Operator  ^ Description                                                ^ Works for...          ^ 
 +| ''%%=%%''         | 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 
 +| ''%%<%%''         | 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 less 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  |
  
-  <box 80% round orange|a title> the box contents</box> +To adress the current date and time, the keyword //now// may be used as an argument.
-  <box 50% left blue>the box contents</box|a caption> +
-  <box 60% round #f99 #fc9 #fcc #f60|title>the box contents></box|caption>+
  
-//[Pictures showing the rendered result will help users to understand]//+//Example:// 
 +  condstyle  : cms-erl = critical change ? "color: red;" : "color:;"
  
-===== Syntax ===== 
- 
-//[Complete syntax]// 
- 
-Basic syntax: 
-<code>{{actionlink>action|title}}</code> 
-  * **action** can be one of this: 
-    * //edit//    --- edit/create/show 
-    * //history// --- old revisions 
- 
-===== Configuration and Settings ===== 
- 
-//[also CSS style tips]// 
  
 ===== Development ===== ===== Development =====
  
-//[downloadable blocks, development comments]//+The pluging is actively maintained and improved.
  
 === Change Log === === Change Log ===
  
-//[preferable GitHub RSS feed or similar]// +FIXME
- +
-  * **2009-01-01** +
-    * Initial release +
- +
-=== Known Bugs and Issues === +
- +
-//[this section might not be needed in case of external bug manager, or use RSS feed]//+
  
 === ToDo/Wish List === === ToDo/Wish List ===
  
-//[developers roadmap]//+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 =====
  
-//[discussions should ideally be deleted and turned into FAQ entries along the way]//+//Nothing yet//
  
 ===== Discussion ===== ===== Discussion =====
  
-//Could be placed on an external page (e.g. plugin:pluginname:discussion) to have a distinction between user comments and author docs// +//nothing yet//
  
  
plugin/structcondstyle.1609109709.txt.gz · Last modified: 2020-12-27 23:55 by larsOhne

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