TestTableUser 

TB Wiki

Login

TestTableUser

Here is the first test of multi-page database tables. (In other words, attribute-style tables).

Introduction [edit section]

The tables on this page are constructed from data obtained from pages that start with the prefix "TestUser"

Table of users, with no extra configuration [edit section]

Following this text, there should be a table of users showing all records and all fields from those records. The fields should be:
  • record_id
  • e_mail
  • phone
  • watches
  • admin_flag

The record_id field for this database has the user's name, and is put into the file using an attribute-name/value pair, with the attribute name being record (as opposed to record_id).

record_id  ^ admin_flag  ^ e_mail  ^ phone  ^ watches  ^
Nadine on nadine@yahoo.com 666-777-8888 RecentChanges
Tim on tim@bird.org 555-555-5555 FrontPage,Portals,Tim_Todo
Query

Table of users, referencing a configuration block [edit section]

This section shows the same data (obtained from all records defined by the files start with "TestUser"), but this time using a configuration block to control output and formatting.

The configuration block is called "UserConf", and is expressed later in this page.

This configuration block specifies to only show the record_id,

phone and watches fields, in that order.

record_id  ^ phone  ^ watches  ^
Nadine 666-777-8888 RecentChanges
Tim 555-555-5555 FrontPage,Portals,Tim_Todo
Query

UserConf configuration block [edit section]

The configuration block can specify all kinds of attributes for the page, including custom forms, row filters, which columns to display, fields attributes such as type, possible values and colors.

The cols attribute indicates the columns to show from this table.

The longest section of this block is the add_form attribute, which has html for a nicely formatted form to add a new record to this database. Adding a record will create a new file consisting of "TestUser" followed by the user name that is entered for the record_id field.

UserConf
unknown_attr=foo
cols=record_id:phone:watches
add_form="""This form is used to add a new user to the system:

<table>
<tr>
<td>Please enter the user name:</td><td> <font color=red>&lt;missing data value for key "record_idField"&gt</font></td>
</tr><tr>
<td>E-mail address:</td><td> <font color=red>&lt;missing data value for key "e_mailField"&gt</font></td>
</tr><tr>
<td>Phone number:</td><td> <font color=red>&lt;missing data value for key "phoneField"&gt</font></td>
</tr><tr>
<td>Pages to watch (expressions):</td><td> <font color=red>&lt;missing data value for key "watchesFieldTextarea"&gt</font></td>
</tr><tr>
<td>Admin:</td><td><font color=red>&lt;missing data value for key "admin_flagFieldCheckbox"&gt</font> This person is has admin privileges</td>
</tr>
</table>
<font color=red>&lt;missing data value for key "SaveButton"&gt</font> <font color=red>&lt;missing data value for key "CancelButton"&gt</font><br>
"""

TBWiki engine 1.9.1 by Tim Bird