Changes between Version 6 and Version 7 of ParametrizedTemplatesPlugin


Ignore:
Timestamp:
Oct 25, 2016, 6:49:43 PM (7 years ago)
Author:
figaro
Comment:

Further cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • ParametrizedTemplatesPlugin

    v6 v7  
    11[[PageOutline(2-5,Contents,pullout)]]
    22
    3 = Trac Parametrized Templates
     3= Create wiki pages from templates
    44
    55== Description
    66
    77Create pages from templates with parameters, using a form to input the parameter values. When making a page template, you can add some parameters. When a new page is created using that template, a form will be displayed, with a field for every parameter, and the page will be created by replacing the values submitted in that form.
     8
     9With 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
     11When 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
     13An 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
     25when 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.
    833
    934== Bugs/Feature Requests
     
    2954General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page.
    3055
    31 == Usage
    32 
    33 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.
    34 
    35 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.
    36 
    3756To activate the plugin, add the following line to your `trac.ini` file:
    3857
     
    4261}}}
    4362
    44 Then create templates containing parameters. Parameter format is '''{{parameter_name, Description or title, field_type, default_value}}''':
     63== Configuration
     64
     65To create templates containing parameters, use the following format: `{{parameter_name, Description or title, field_type, default_value}}`.
    4566
    4667 * Available field types are:
    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.
    7471
    7572== Recent Changes