plugin:datatemplate
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:datatemplate [2012-07-08 15:36] – added dependency Klap-in | plugin:datatemplate [2022-12-06 11:59] (current) – [Data Template Plugin] Search for new maintainer(s) Cyrille37 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Data Template | + | ====== Data Template |
---- plugin ---- | ---- plugin ---- | ||
description: | description: | ||
- | author | + | author |
- | email : christoph.clausen@gmail.com | + | email : cyrille@giquello.fr |
type : syntax | type : syntax | ||
- | lastupdate : 2011-08-27 | + | lastupdate : 2016-08-03 |
- | compatible : rincewind | + | compatible : 2017-02-19 " |
depends | depends | ||
conflicts | conflicts | ||
Line 13: | Line 13: | ||
tags : data, database, listing, template | tags : data, database, listing, template | ||
- | downloadurl: | + | downloadurl: |
- | bugtracker : https:// | + | bugtracker : https:// |
- | sourcerepo : https:// | + | sourcerepo : https:// |
donationurl: | donationurl: | ||
---- | ---- | ||
- | This plugin adds the possibility to display the structered | + | :?: :!: [[https:// |
+ | |||
+ | This plugin adds the possibility to display the structured | ||
to individual data entries or lists of multiple entries. Additionally, | to individual data entries or lists of multiple entries. Additionally, | ||
+ | |||
+ | News: The original author, Christoph Clausen, cannot maintain anymore the plugin, so I adopt it ;-) Thanks a lot to him to have built first steps and accepted the adoption in 2016 august. | ||
===== Download and Installation ===== | ===== Download and Installation ===== | ||
- | Download | + | Search |
==== Change Log ==== | ==== Change Log ==== | ||
- | {{rss>http:// | + | * 2016-08-02 Add translation for list navigation links and filter button |
+ | * 2016-08-02 Cyrille Giquello adopted the plugin with Christoph Clausen agreement | ||
+ | * 2016-07-11 fix deprecated constructor calls | ||
+ | |||
+ | Last github commits on release [[https:// | ||
+ | |||
+ | {{rss>https:// | ||
===== Template Definition ===== | ===== Template Definition ===== | ||
+ | |||
Templates are separate wiki pages containing placeholders. There are two kinds of placeholders: | Templates are separate wiki pages containing placeholders. There are two kinds of placeholders: | ||
* Placeholders enclosed by '' | * Placeholders enclosed by '' | ||
- | * Placeholders with an additional exclamation in front of the placeholder name, like in '' | + | * Placeholders with an additional exclamation in front of the placeholder name, like in '' |
+ | * :!: Placeholders with capital letter do not work in the current version | ||
==== Example ==== | ==== Example ==== | ||
+ | |||
A template definition as in | A template definition as in | ||
- | < | + | |
- | === @@Page@@ === | + | <code - tpl_member> |
+ | {{@@!imgname@@? | ||
+ | * **Position**: | ||
+ | * **Address**: | ||
+ | * **Phone**: @@phone@@ | ||
+ | * **E-Mail**: @@email@@ | ||
+ | </ | ||
+ | |||
+ | OR | ||
+ | |||
+ | < | ||
+ | === @@%title%@@ === | ||
{{@@!imgname@@? | {{@@!imgname@@? | ||
Line 44: | Line 68: | ||
**E-Mail**: @@email@@ | **E-Mail**: @@email@@ | ||
</ | </ | ||
- | will use whatever value is stored in the field '' | + | |
+ | will use whatever value is stored in the field '' | ||
===== Syntax ===== | ===== Syntax ===== | ||
- | This plugin provides **3** different syntax blocks. The first two are essentially the same as for the data plugin, but with an added '' | ||
- | * The '' | ||
- | * The '' | ||
- | The value of the '' | + | This plugin provides **3** different syntax blocks: |
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | |||
+ | The first two are essentially the same as for the data plugin, but with an added '' | ||
+ | |||
+ | ==== datatemplateentry ==== | ||
+ | |||
+ | The '' | ||
+ | |||
+ | The value of the '' | ||
< | < | ||
---- datatemplateentry member ---- | ---- datatemplateentry member ---- | ||
- | template | + | template |
- | firstname | + | firstname |
- | lastname | + | lastname |
- | type | + | type : PhD Student |
- | active | + | active |
- | addr : GAP-Optique \\ Rue de l' | + | phone |
+ | email_mail | ||
+ | imgname_img : pics: | ||
+ | addr | ||
---- | ---- | ||
</ | </ | ||
+ | |||
+ | Not all types supported by the data plugin are implemented. Current supported types are: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | When no type is given the input is handled as wiki text. | ||
+ | |||
+ | ==== datatemplatelist ==== | ||
+ | |||
+ | The '' | ||
+ | |||
+ | Example syntax: | ||
+ | |||
+ | < | ||
+ | ---- datatemplatelist ---- | ||
+ | template: tpl_memberlist | ||
+ | cols : %title%, imgname, phone, email_mail | ||
+ | sort : firstname | ||
+ | filter | ||
+ | and : type=Group Leader | ||
+ | and : active=yes | ||
+ | ---- | ||
+ | </ | ||
+ | |||
+ | This list all the pages in '' | ||
+ | |||
+ | The '' | ||
+ | |||
+ | ^Column name ^ Appearance^ Placeholder | ||
+ | | %title% | ||
+ | | %pageid% | ||
+ | | %class% | ||
+ | | %lastmod% | The date of last modification of the entry | @@%lastmod%@@ | | ||
+ | |||
+ | Beside the columns you list in '' | ||
+ | |||
+ | === Deprecated === | ||
+ | |||
+ | Untill 18 May 2013 the special placeholders above where available by their localized title. To simplify their usage, you can now only use the column names as mentioned above. | ||
+ | |||
+ | ^Column name ^ Title depending on localization((English localization listed here))\\ as used in placeholder^ | ||
+ | |%title% | ||
+ | |%pageid% | ||
+ | |%class% | ||
+ | |%lastmod% |@@Last Modified@@| | ||
==== Filter Form ==== | ==== Filter Form ==== | ||
+ | |||
The filter form adds new functionality to the '' | The filter form adds new functionality to the '' | ||
+ | |||
< | < | ||
---- filterform ---- | ---- filterform ---- | ||
Line 70: | Line 160: | ||
---- | ---- | ||
</ | </ | ||
- | The single parameter '' | + | |
+ | The single parameter '' | ||
+ | |||
+ | Next to the dropdown list is a text field. When the form is submitted, only those data entries are displayed, where the column selected in the dropdown box contains the text in the text field. This effectively corresponds to adding a line like '' | ||
It is possible to add more and more filter criteria by repeatedly submitting the form. Also, applied filters can later be removed individually. | It is possible to add more and more filter criteria by repeatedly submitting the form. Also, applied filters can later be removed individually. | ||
===== Demonstration ===== | ===== Demonstration ===== | ||
- | For a demonstration, | + | |
+ | For a demonstration, | ||
+ | |||
+ | The [[http:// | ||
+ | |||
+ | As another example I am using this plugin on my personal website to provide a pretty index page for a collection of [[http:// | ||
===== A technical note about caching ===== | ===== A technical note about caching ===== | ||
+ | |||
The data plugins stores its data as simple key-value pairs in an SQLite database. While this leads to a lot of flexibility, | The data plugins stores its data as simple key-value pairs in an SQLite database. While this leads to a lot of flexibility, | ||
disadvantage when querying the data from the database. To obtain something that looks like a result from " | disadvantage when querying the data from the database. To obtain something that looks like a result from " | ||
Line 85: | Line 184: | ||
- **Validation: | - **Validation: | ||
- **Building: | - **Building: | ||
- | - **Storage: | + | - **Storage: |
- | One can force a rebuild of the cache by using the [[devel: | + | One can force a rebuild of the cache by using the [[devel: |
===== Shortcomings ===== | ===== Shortcomings ===== | ||
+ | |||
In the current state, this plugin leaves room for improvements. Some of the currently known issues are | In the current state, this plugin leaves room for improvements. Some of the currently known issues are | ||
* The plugin is not able to detect circular dependencies in the rendering of templates. | * The plugin is not able to detect circular dependencies in the rendering of templates. | ||
Line 101: | Line 201: | ||
===== Acknowledgements ===== | ===== Acknowledgements ===== | ||
- | This plugin was inspired by the [[dataloop|dataloop plugin]] by Martyn Eggleton. Much of the template rendering code is based on the | + | |
- | [[templater|templater plugin]] by Jonathan Arkell. | + | First years, until 2016 august, of this plugin was released and maintained by Christoph Clausen. |
+ | |||
+ | This plugin was inspired by the [[dataloop|dataloop plugin]] by Martyn Eggleton. Much of the template rendering code is based on the [[templater|templater plugin]] by Jonathan Arkell. | ||
===== Bugs, Feature Requests and Patches ===== | ===== Bugs, Feature Requests and Patches ===== | ||
Please submit bugs and feature requests in the issue tracker linked at the top. | Please submit bugs and feature requests in the issue tracker linked at the top. | ||
- |
plugin/datatemplate.1341754589.txt.gz · Last modified: 2012-07-08 15:36 by Klap-in