| 8 | |
| 9 | With this plugin, it is possible to add parameters to a wiki page template, so when creating a new wiki page from this template an intermediate form is displayed, where a field is shown for each of the parameters in the template. |
| 10 | |
| 11 | When the form is submitted, the page is created from the template, replacing every parameter specification in the template with the values from the form. |
| 12 | |
| 13 | An example template: |
| 14 | |
| 15 | {{{ |
| 16 | |
| 17 | = Example page template |
| 18 | |
| 19 | This is value of parameter 1: {{param1, Title for parameter 1}} |
| 20 | |
| 21 | This is a textarea parameter 2: {{param2, Title for parameter 2, textarea}} |
| 22 | |
| 23 | }}} |
| 24 | |
| 25 | when creating a new page from that template, you will get a form like: |
| 26 | |
| 27 | [[Image(screenshot.png)]] |
| 28 | |
| 29 | '''Notes''': |
| 30 | * If a parameter is repeated over the template (same parameter name), only one entry will be shown in the form, using the description from the first occurrence. |
| 31 | * A new page can be created using the url `/newpage/PageName?template=TemplateName`. |
| 32 | * The plugin will intercept when a new page is created via the traditional way (`/wiki/PageName?template=TemplateName`), if the page doesn't exist and the template does contain any parameters, and will redirect the user to `/newpage/PageName?template=TemplateName` to fill the form. |
47 | | * '''textarea''': a big text area with scrollboxes |
48 | | * '''text''', by default, or if not specified, a single line text box |
49 | | * ''default_value'': Sets a default value for this parameter, instead of empty. If a default_value is set, ''field_type'' must be set too. |
50 | | |
51 | | === Example |
52 | | |
53 | | An example template: |
54 | | |
55 | | {{{ |
56 | | |
57 | | = Example page template = |
58 | | |
59 | | This is value of parameter 1: {{param1, Title for parameter 1}} |
60 | | |
61 | | This is a textare parameter 2: {{param2, Title for parameter 2, textarea}} |
62 | | |
63 | | }}} |
64 | | |
65 | | when creating a new page from that template, you will get a form like: |
66 | | |
67 | | [[Image(screenshot.png)]] |
68 | | |
69 | | === Notes |
70 | | |
71 | | * If a parameter is repeated over the template (same parameter name), only one entry will be shown in the form, using the description from the first ocurrence. |
72 | | * A new page can be created using the url '''/newpage/PageName?template=TemplateName''' |
73 | | * The plugin will intercept when a new page is created via the traditional way (/wiki/PageName?template=TemplateName), if the page doesn't exist and the template does contain any parameters, and will redirect the user to '''/newpage/PageName?template=TemplateName''' in order to fill the form. |
| 68 | * '''textarea''': a big text area with scrollboxes. |
| 69 | * '''text''', by default, or if not specified, a single line text box. |
| 70 | * '''default_value''': Sets a default value for this parameter, instead of empty. If a default_value is set, then `field_type` must be set too. |