root/trunk/ConfigAssistant/CONFIGASSIST-README.txt

Revision 1513, 3.5 kB (checked in by breese, 8 months ago)

updated readme

Line 
1# Configuration Assistant
2# Author: Byrne Reese
3# Copyright 2008 Six Apart, Ltd.
4# License: Artistic, licensed under the same terms as Perl itself
5
6OVERVIEW
7
8This plugin is prototype for how to allow theme and plugin developers to easily
9surface a form within Movable Type for configuring their theme/plugin and the
10corresponding template tags that can be used within a template WITHOUT HAVING
11TO USE PERL AT ALL!
12
13This plugin works by allowing a developer to use their plugin's configuration
14file as a means for defining what the various settings and form elements they
15would like to expose to a user.
16
17See the SAMPLE CONFIG YAML below for an idea of how this works.
18
19PREREQUISITES
20
21- Movable Type 4.1 or higher
22
23INSTALLATION
24
25  1. Unpack the ConfigAssistant archive.
26  2. Copy the contents of ConfigAssistant/plugins into /path/to/mt/plugins/
27
28REFERENCE
29
30The data structure for input form elements is relatively straight forward.
31This plugin adds support for a new registry key called "plugin_config".
32
33The plugin_config element has a child element which corresponds the plugin's
34id. It is this element under which all the various fields are defined under
35"fieldsets".
36
37Each plugin can have multiple fieldsets, or grouping of input parameters.
38Each fieldset should have a unique key or identifier.
39
40Under each fieldset is a sequence of fields.
41
42Each field supports the following properties:
43
44  * type - the type of the field. Supported values are: text, textarea, select,
45           checkbox
46  * label - the label to display to the left of the input element
47  * hint - the hint text to display below the input element
48  * tag - the template tag that will access the value held by the corresponding
49          input element
50  * values - valid only for fields of type "select" - this contains a comma
51             delimitted list of values to present in the pull down menu
52  * rows - valid only for fields of type "textarea" - this corresponds to the
53           number of rows of text displayed for the text area input element
54
55In order to surface the form under your plugin's settings area, you will need
56to define a blog configuration template like so:
57
58    blog_config_template: '<mt:PluginConfigForm id="MyPluginID">'
59
60TEMPLATE TAGS
61
62Each plugin configuration field can define a template tag by which a designer
63or developer can access its value. If a tag name terminates in a question mark
64then the system will interpret the tag as a block element. Here are two example
65configs:
66
67    feedburner_id:
68        type: text
69        label: "Feedburner ID"
70        hint: "This is the name of your Feedburner feed."
71        tag: 'FeedburnerID'
72    use_feedburner:
73        type: checkbox
74        label: "Use Feedburner?"
75        tag: 'IfFeedburner?'
76
77And here are corresponding template tags that make use of these configuration
78options:
79
80    <mt:IfFeedburner>
81      My feedburner id is <mt:FeedburnerID>.
82    <mt:Else>
83      Feedburner is disabled!
84    </mt:IfFeedburner>
85
86SAMPLE CONFIG YAML
87
88    blog_config_template: '<mt:PluginConfigForm id="MyPluginID">'
89    plugin_config:
90        MyPluginID:
91            fieldset_1:
92                label: "This is a label for my fieldset"
93                description: "This is some text to display below my fieldset label"
94                feedburner_id:
95                    type: text
96                    label: "Feedburner ID"
97                    hint: "This is the name of your Feedburner feed."
98                    tag: 'MyPluginFeedburnerID'
99
100SUPPORT
101
102http://forums.movabletype.org/codesixapartcom/project-support/
103
Note: See TracBrowser for help on using the browser.