1.1. Calling the table editor
In its simplest form, table-editor is called in an ITL page with:
[table-editor table=products key=os28004][/table-editor]
That will edit the table products using its default configuration, for the SKU os28004.
If no metadata is defined for the table, all fields are edited. To limit it with the tag call:
[table-editor
table=products
key=os28004
fields="sku price description" ][/table-editor]
To specify that the field description should have a different widget type, height, and width, you can specify:
[table-editor
table=products
key=os28004
fields="sku price description"
widget.description=textarea
width.description=50
height.description=10
][/table-editor]
If you do this with the default foundation demo catalog, you will see:
SKU __________________________________
Product Price __________
+---------------------------------------------+
| |
Short | |
Description | |
| |
+---------------------------------------------+
Note that the labels are pulled from the mv_metadata definition -- any attributes not specified in the options do that. You can override each in turn -- to change SKU to "Part Number" you can do:
[table-editor
table=products
key=os28004
fields="sku price description"
label.sku="Part number"
widget.description=textarea
width.description=50
height.description=10
][/table-editor]
To change the style of the label column, you can set the style information with:
[table-editor
table=products
key=os28004
fields="sku price description"
label_cell_style="font-weight: bold"
label.sku="Part number"
widget.description=textarea
width.description=50
height.description=10
][/table-editor]
This should bold the label text.
These are just a few small examples. There are more than 150 options for table editor which we will discuss below.