Use struct data to fill in a template, as many times as there are results
Compatible with DokuWiki
Similar to dataloop, datatemplate, structtemplating
External requirements: This plugin requires the following additional components that must be installed separately:
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
Social media links:
With a struct schema, socialmedia
:
name | link |
---|---|
Facebook | https://www.facebook.com/pages/DokuWiki/52877633616 |
Twitter | https://twitter.com/dokuwiki |
GitHub | https://github.com/dokuwiki/dokuwiki |
… the following template:
<struct-template> ---- data ---- schema : socialmedia cols : name, link ---- [[{{$$socialmedia.link}}|{{$$socialmedia.name}}]] </struct-template>
… will render as:
<struct-template> ---- data ---- schema : ... cols : ... filter : ... sort : ... ---- ... </struct-template>
The opening tag can be any of the following:
<struct-template>
or <struct-template inline>
: will be enclosed in any element from outside the template<STRUCT-TEMPLATE>
or <struct-template block>
: any block-level element before the template will be closed before rendering; if using the capitalised version, the end tag must be </STRUCT-TEMPLATE>
The data block can be pretty much any syntax from the struct table aggregation; each entry in the resulting data will be used once to render the template.
Following the data block, the template will be interpreted as Wiki text in the normal DokuWiki format. Entries from the data can be used with a similar syntax to the struct value aggregation, but using a double dollar sign:
{{$$schema.column}} {{$$%pageid%}}
Unlike the struct value aggregation, the schema must always be supplied. You can still use the actual struct value aggregation ({{$[page].[schema].column}}
).
If the DokuWiki HTML OK configuration setting is enabled, you can add a flag to the opening template tag to interpret the template as HTML, without having to render the Wiki text. This can speed up processing by a lot on a page with a few templates on.
<struct-template inline html> ... </struct-template>
The html
option must come after the inline
or block
specifier.
Please report bugs and issues at https://github.com/iainhallam/dokuwiki-plugin-structtemplate/issues
[discussions should ideally be deleted and turned into FAQ entries along the way]
Please sign your contribution with the button in the editor controls.