====== Struct Templating Plugin ====== ---- plugin ---- description: Use Twig templates for custom struct data rendering author : Frieder Schrempf email : dev@fris.de type : action lastupdate : 2021-05-21 compatible : depends : struct conflicts : similar : structtemplate tags : downloadurl: https://github.com/fschrempf/dokuwiki-plugin-structtemplating/archive/refs/heads/main.zip bugtracker : https://github.com/fschrempf/dokuwiki-plugin-structtemplating/issues sourcerepo : https://github.com/fschrempf/dokuwiki-plugin-structtemplating donationurl: screenshot_img : ---- ===== Installation ===== :!: **External requirements:** This plugin requires the following additional components that must be installed separately: * [[:plugin:struct]] Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually. ===== Examples/Usage ===== Add Twig templates in ''lib/plugin/structtemplating/assets/templates/schema/.twig'' which will then be used to render the struct schema data attached to the page before the body is rendered. You can access properties of the schema through the schema variable and by calling functions available in the [[https://github.com/cosmocode/dokuwiki-plugin-struct/blob/master/meta/Schema.php|Schema class]]. The field data is available through the data array. Each element also has a rendered property that contains the result of the DokuWiki's renderer. The raw values can be accessed via getValue or other methods in the [[https://github.com/cosmocode/dokuwiki-plugin-struct/blob/master/meta/Value.php|Value class]]. See [[https://github.com/fschrempf/dokuwiki-plugin-structtemplating/blob/main/default.twig.example|default.twig.example]] for some examples. ==== Stylesheets ==== By default the plugin installs a style.less stylesheet that imports assets/style/style.less. This allows you to add your custom stylesheets in the assets/style/ directory and track them together with your templates. ==== Tracking Changes in Templates and Stylesheets ==== The assets directory is empty when the plugin is installed. You can use it as the root for a git repository to put your templates and stylesheets under version control. === Change Log === {{rss>https://github.com/fschrempf/dokuwiki-plugin-structtemplating/commits/main.atom date}} ===== FAQ ===== ===== Discussion =====