This is an old revision of the document!
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 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 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.