How to create templates
Since 4.620, Woda allows user to create or modify database directly from the web interface. Database can be created from scratch or using templates. One can also change the apparence on the fly using predefined styles, icons and layoutTemplates or by creating a simple page template (set in $WBB{pageTemplate}).
How to setup all of this is shortly explained in [On the fly databases].
Some database templates, styles and icons sets are provided with Woda. Here's a brief documentation to help create new ones.
See $TEMPLATEDIR in woda.conf
How to create templates for database
- simple as copy your normal databases perl script (but remove perl and woda path)
- name of templates should not contains dots
- no relational features (??)
- use special WBB (for Base) and WBF (for Fields) settings to allow things to be changed :
# allow admin to modify this setting
$WBB{setting name,'config'} = 'yes|no';
# will be printed above setting in form
$WBB{setting name,'help'} = 'help text to be shown when editing setting';
$WBB{structureTemplate} = 'which template was used';
$TITLE template title, if undefined $WBB{'dbTitle'} is used
$DOCS template documentation, if undefined $WBB{'about'} is used
- one can also define a list of hidden fieds, settings and cgi with $HIDDENWBF, $HIDDENWBB and $HIDDENCGI respectively. This can also be set globaly in woda.conf or common.pl
- use dd.pl to overwrite any user defined setting.
- $TEMPLATEDIR/lib is a place for requireFile
How to create templates for styles
- the style template is a $WBB{style} setting
- simply copy your entire CSS style definition with $WBB{'style'}, like this
$WBB{'style'} = <<'EOF';
.TITLE { color: #F25125;}
.MENU { color: #B6D213;}
...
EOF
- name of templates should not contains dots, rename file.css to file or file-css
- set $WBB{'styleTemplate'}
How to create templates for pages (layouts templates)
- set $WBB{'layoutTemplate'} Not yet, code is not finished.
- can use pageTemplate
How to create icons sets
- look for $ICONDIR in woda.conf, change it to something useful
- put your icon set in $ICONDIR (in its own directory)
- the names of the files should be the same as those of the supplied icons.
- icons should be created in .GIF format, typically 24*24 pixels.