DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:struct:bureaucracy

Struct Plugin

Struct Plugin: Bureaucracy Support

The Struct Plugin supports integration with the Bureaucracy Plugin. This allows reusing the input mechanisms of the different types in bureaucracy forms and creation of structured data when pages are created through Bureaucracy's template action.

Single Field

You can use any field from any defined schema as a field in a Bureaucracy form. To do so simply use the type struct_field and specify the field name in the form of <schema>.<name>.

<form>
Action template templates:product product :
struct_field "products.product" @
submit "Create new product"
</form>

The defined (translated) label will automatically be used for the field as well as all the validation rules configured in the schema.

You can use the value entered in a Struct field as any other value for templating. Eg. you can use @@products.product@@ to access the value of the example above.

All Struct values will be assigned to the resulting pages of (when using the Bureaucracy template action), provided the schema assignments match.

Complete Schema

Instead of adding individual fields to a Bureaucracy form as described above, you can also add a whole schema to the form. To do so, simply use the struct_schema command.

<form>
Action template templates:product product :
textbox name @
struct_schema "product" !
submit "Create new product"
</form>

Please note that all additional parameters given will be added to each individual field. Eg. you can only make all fields of the schema mandatory or optional.

Templates

At the moment it isn't possible to use pre-filled fields as templates in the Bureaucracy – fieldset.

plugin/struct/bureaucracy.txt · Last modified: 2017-10-27 19:46 by Aleksandr