Search code examples
dokuwiki

Using a template in struct plugin


The struct plugin is nice for managing structured data. But so far the only way I found to present the data for one single entry is a simple automatically generated table at the top of the page followed by the content of the entrys wiki text. Since I need the single entry pages to look better, I want to replace the simple table with something more pleasing to the eye like a template page that gets included into the page itself using {page>_mytemplate}.

The mytemplate wiki page might look like this:

==== STRUCTFIELD_TITLE ====

The STRUCTFIELD_NAME is a STRUCTFIELD_CLASSIFICATION consisting
of STRUCTFIELD_INGREDIENTS.

"STRUCTFIELD_*" should be replaced with the fields defined in the schema of course.


The wiki page of the single entry should include the template page as mentioned above with {page>mytemplate}.

So my question in essence is: How to include single fields of a schema into a wiki page as template variables, and can this be further automated using one "template wiki page" that gets included via the {page>...} command?


Solution

  • Found a solution. It is discussed in detail here: https://github.com/cosmocode/dokuwiki-plugin-struct/issues/145

    In a nutshell: There is a version of the Struct plugin which includes all the functionality needed: https://github.com/iainhallam/dokuwiki-plugin-struct/tree/feature/value