Config Assistant Registry Settings
Config Assistant is driven 100% by configuration data you place in your plugin's
config.yaml. In addition to defining a new data structure for use within your
config.yaml, Config Assistant makes use of the following registry keys as well:
settings- you still need to register the values that will be stored in the database.
system_config_template- you also need to provide templates to properly display the form defined by the
plugin_configregistry data structure.
The new registry data structure parsed exclusively by Config Assistant is associated with the registry key
plugin_config. This element has a single child element, corresponding to the plugin's id for which you are defining configuration options. It is this element which will contain each of your plugin's configuration options and input elements, grouped by fieldset. Let's look at an example that stubs out one possible
plugin_config data structure:
plugin_config: MyPluginID: ServerInfo: server_host: *snip* server_port: *snip* PluginOptions: use_https: *snip* http_auth_username: *snip* http_auth_password: *snip*
The sample above defines two field sets:
Each of these field sets will be encapsulated by the HTML element from which they get their name:
<fieldset id="ServerInfo"> <!-- form elements go here --> </fieldset> <fieldset id="PluginOptions"> <!-- form elements go here --> </fieldset>
Field sets like this provide the benefit of visually grouping related configuration options together. They have no bearing on the functionality of your plugin.
Within each of these field sets, Config Assistant will render their associated form input elements, or "fields."
Each field then supports the following registry properties:
type - the type of the field. Supported values are: text, textarea, select, checkbox.
label - the label to display to the left of the input element
hint - the hint text to display below the input element
tag - the template tag that will access the value held by the corresponding input element
values - valid only for fields of type "select" - this contains a comma delimitted list of values to present in the pull down menu
rows - valid only for fields of type "textarea" - this corresponds to the number of rows of text displayed for the text area input element
Finally, in order for Config Assistant to properly surface the form under your plugin's settings area, you will need to define a blog configuration template using the
blog_config_template registry property like so:
blog_config_template: '<mt:PluginConfigForm id="MyPluginID">'
This page is part of the Building Movable Type Applications
- Previous Using Configuration Assistant