1# Struct Templating Plugin for DokuWiki
2
3Use twig templates for custom struct data rendering.
4
5## Installing
6
7If you install this plugin manually, make sure it is installed in
8lib/plugins/structtemplating/ - if the folder is called different it
9will not work!
10
11Please refer to http://www.dokuwiki.org/plugins for additional info
12on how to install plugins in DokuWiki.
13
14## Usage
15
16### Templates
17
18After installing the plugin, an admin can add twig template files in the
19`lib/plugin/structtemplating/assets/templates/schema` directory on the server.
20
21Currently only templates for schema page data are supported. The filename of
22the template file must be `<schema>.twig`.
23
24You can access properties of the schema through the `schema` variable and
25by calling functions available in the [`Schema` class](https://github.com/cosmocode/dokuwiki-plugin-struct/blob/master/meta/Schema.php).
26
27The field data is available through the `data` array. Each element also has
28a `rendered` property that contains the result of the DokuWiki's renderer.
29
30The raw values can be accessed via `getValue` or other methods in the
31[`Value` class](https://github.com/cosmocode/dokuwiki-plugin-struct/blob/master/meta/Value.php).
32
33See `default.twig.example` for some examples.
34
35### Stylesheets
36
37By default the plugin installs a `style.less` stylesheet that imports
38`assets/style/style.less`. This allows you to add your custom stylesheets in the
39`assets/style/` directory and track them together with your templates.
40
41### Tracking Changes in Templates and Stylesheets
42
43The `assets` directory is empty when the plugin is installed. You can use it as
44the root for a git repository to put your templates and stylesheets under
45version control.
46
47## Copyright
48
49Copyright (C) Frieder Schrempf <dev@fris.de>
50
51## License
52
53GPL-2.0-only, see LICENSE file