plugin:data
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:data [2016-04-04 05:17] – [Download and Installationff] 111.193.48.226 | plugin:data [2024-02-01 23:50] (current) – version upped andi | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
---- plugin ---- | ---- plugin ---- | ||
Line 6: | Line 6: | ||
email : andi@splitbrain.org | email : andi@splitbrain.org | ||
type : syntax, action, helper | type : syntax, action, helper | ||
- | lastupdate : 2016-03-11 | + | lastupdate : 2024-01-30 |
- | compatible : Detritus, Hrun, Ponder Stibbons, Binky, Weatherwax, Adora Belle | + | compatible : Hogfather, Greebo, Frusterick Manners, Elenor Of Tsort, |
depends | depends | ||
conflicts | conflicts | ||
Line 20: | Line 20: | ||
This plugin allows you to add structured data to any DokuWiki page. Think about this data as additional named attributes. Those attributes can then be queried and aggregated. The plugin is similar to what was done here for the [[repository|repository plugin]] but its internals are very different to it. | This plugin allows you to add structured data to any DokuWiki page. Think about this data as additional named attributes. Those attributes can then be queried and aggregated. The plugin is similar to what was done here for the [[repository|repository plugin]] but its internals are very different to it. | ||
+ | |||
+ | :!: You might want to consider using the spiritual successor to this plugin: [[plugin: | ||
===== Download and Installation ===== | ===== Download and Installation ===== | ||
- | Install | + | Search and install |
==== Changes ==== | ==== Changes ==== | ||
Line 148: | Line 150: | ||
For filtering, multiple comparators are possible: | For filtering, multiple comparators are possible: | ||
- | ^ Comparator | + | ^ Comparator |
- | | '' | + | | '' |
- | | '' | + | | '' |
- | | ''<'' | + | | ''<'' |
- | | '' | + | | '' |
- | | ''>'' | + | | ''>'' |
- | | '' | + | | '' |
- | | '' | + | | '' |
- | | '' | + | | '' |
- | | '' | + | | '' |
- | | '' | + | | '' |
You may use the special variables in a filter to make it match against current logged in user or current date e.g. '' | You may use the special variables in a filter to make it match against current logged in user or current date e.g. '' | ||
- | ^Variable for filtervalue ^ Meaning ^ | + | ^ Variable for filtervalue |
- | | %user% | match against the currently logged in user | | + | | %user% |
- | | %group% | match against the groups of the current user; use the '' | + | | %groups% | match against the groups of the current user; use the '' |
- | | %now% | compare with the current date | | + | | %now% |
- | | %lang% | Language code of your default wiki language. e.g. '' | + | | %lang% |
- | | %trans% | + | | %trans% |
Line 305: | Line 307: | ||
</ | </ | ||
- | And in Admin -> Page Aliases ('' | + | And in Admin -> Data Plugin: Field Aliases ('' |
^ Type Alias ^ Type ^ Data Prefix ^ Data Postfix ^ Valid values | | ^ Type Alias ^ Type ^ Data Prefix ^ Data Postfix ^ Valid values | | ||
Line 345: | Line 347: | ||
=== vCard type alias with vCard Plugin === | === vCard type alias with vCard Plugin === | ||
- | Setup for the [[plugin: | + | |
+ | Setup for the [[plugin: | ||
Line 400: | Line 403: | ||
===== Translation Support ===== | ===== Translation Support ===== | ||
- | If you use the [[translation]] plugin, you might want to use the same data entries in different languages. The plugin allows for translated field names - values will not be translated. If you only want to use English field names while having them displayed in your language, you can also follow these instructions. | + | If you use the [[translation]] plugin, you might want to use the same data entries in different languages. The plugin allows for translated field names -- values will not be translated. If you only want to use English field names while having them displayed in your language, you can also follow these instructions. |
To create fieldname translations, | To create fieldname translations, | ||
Line 412: | Line 415: | ||
Fieldnames are to be given without their type. So it's '' | Fieldnames are to be given without their type. So it's '' | ||
- | After creating or modifiying data-plugin.php file, please update wiki configuration to refresh cache '' | + | After creating or modifiying data-plugin.php file, please update wiki configuration to refresh cache '' |
===== Missing Features ===== | ===== Missing Features ===== | ||
Line 418: | Line 421: | ||
* more control options: | * more control options: | ||
* attribute list (similar to tag cloud but as a simple list) | * attribute list (similar to tag cloud but as a simple list) | ||
- | * search field -- See [[plugin: | + | * search field -- see [[plugin: |
* **better documentation, | * **better documentation, | ||
* Please provide suggestions for which pieces need more attention or where you do not understand stuff. Thanks. | * Please provide suggestions for which pieces need more attention or where you do not understand stuff. Thanks. | ||
Line 436: | Line 439: | ||
* This plugin may be seen in action on this wiki in the [[: | * This plugin may be seen in action on this wiki in the [[: | ||
* Look for the '' | * Look for the '' | ||
- | * and for a '' | + | * and for a '' |
* Very interesting and organized wiki setup: [[http:// | * Very interesting and organized wiki setup: [[http:// | ||
* [[plugin: | * [[plugin: | ||
Line 460: | Line 463: | ||
The [[plugin: | The [[plugin: | ||
- | ==== How do you filter empty fields/ | + | ==== How do you filter empty fields/ |
- | Suppose some entries contain empty fields and you want to display such entries : how do you write the filter in the query to output these ? | + | Suppose some entries contain empty fields and you want to display such entries: how do you write the filter in the query to output these? |
- | e.g | + | e.g. |
< | < | ||
Line 476: | Line 479: | ||
</ | </ | ||
- | and if the query is : | + | and if the query is: |
< | < | ||
---- datatable ---- | ---- datatable ---- | ||
Line 485: | Line 488: | ||
</ | </ | ||
the output does not show the above record | the output does not show the above record | ||
+ | |||
+ | ^The solution is to change the filter to a value that will always be populated. ^ | ||
+ | |< | ||
+ | cols : %pageid% | ||
+ | headers : Details | ||
+ | filter | ||
+ | ----</ | ||
+ | | --- [[user> | ||
+ | |||
+ | ==== Why don't my variables/ | ||
+ | |||
+ | DokuWiki calls [[phpfn> | ||
+ | |||
==== Other Questions ==== | ==== Other Questions ==== | ||
- | If you still have questions, search the forum and if it hasn't been asked before ask your question there. Please leave bugreports | + | If you still have questions, search the forum and if it hasn't been asked before ask your question there. Please leave bug reports |
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Customisations ===== | ||
+ | |||
+ | **Important!** These are //hacks// -- there is no guarantee they' | ||
+ | |||
+ | If it breaks you get to keep the pieces. :-) | ||
+ | |||
+ | ==== Customise the Date Format ==== | ||
+ | |||
+ | **NOTE:** The configuration setting for the PHP strftime function in ''/ | ||
+ | |||
+ | To change the default date format from '' | ||
+ | |||
+ | Change this: | ||
+ | <code php plugins/ | ||
+ | /** | ||
+ | * Replace placeholders in sql | ||
+ | */ | ||
+ | function _replacePlaceholdersInSQL(& | ||
+ | global $USERINFO; | ||
+ | // allow current user name in filter: | ||
+ | $data[' | ||
+ | $data[' | ||
+ | // allow current date in filter: | ||
+ | $data[' | ||
+ | |||
+ | // language filter | ||
+ | $data[' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | to this: | ||
+ | <code php plugins/ | ||
+ | /** | ||
+ | * Replace placeholders in sql | ||
+ | */ | ||
+ | function _replacePlaceholdersInSQL(& | ||
+ | global $USERINFO; | ||
+ | // allow current user name in filter: | ||
+ | $data[' | ||
+ | $data[' | ||
+ | // allow current date in filter: | ||
+ | $data[' | ||
+ | |||
+ | // language filter | ||
+ | $data[' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | and change this: | ||
+ | <code php plugins/ | ||
+ | switch($type) { | ||
+ | case ' | ||
+ | if(preg_match('/ | ||
+ | return sprintf(' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | to this: | ||
+ | <code php plugins/ | ||
+ | switch($type) { | ||
+ | case ' | ||
+ | if(preg_match('/ | ||
+ | return sprintf(' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | and change this: | ||
+ | <code javascript plugins/ | ||
+ | /** | ||
+ | * Init datepicker for all date fields | ||
+ | */ | ||
+ | jQuery(function () { | ||
+ | jQuery(' | ||
+ | dateFormat: " | ||
+ | changeMonth: | ||
+ | changeYear: true | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | to this: | ||
+ | <code javascript plugins/ | ||
+ | /** | ||
+ | * Init datepicker for all date fields | ||
+ | */ | ||
+ | jQuery(function () { | ||
+ | jQuery(' | ||
+ | dateFormat: " | ||
+ | changeMonth: | ||
+ | changeYear: true | ||
+ | }); | ||
+ | </ | ||
===== Bugs, Feature Requests and Patches ===== | ===== Bugs, Feature Requests and Patches ===== | ||
- | Please submit bugs and feature requests in the [[https:// | + | Please submit bugs and feature requests in the [[https:// |
plugin/data.1459739870.txt.gz · Last modified: 2016-04-04 05:17 by 111.193.48.226