Hi,
I think I well understand now.
What you need to do, is a "main-block + sub-block" structure with a data source which is an Array. Sub-blocks are possible with TBS but only with data source using string queries (SQL).
I think I gonna add a feature for sub-block with array data source.
But for now here are many solutions:
* Using sub-blocks (complicated but smart):
Main-block should be the Field list, sub-block should be the item list, and parameter 'p1' should be on the type id. (see manual for more information about p1)
But because of what I told before, you will have to code custom data source functions for the sub-blocks. For a given p1 value, the function will have to return the items for type p1.
* Using 1 block (easy and aswer your last question):
Instead of saving items of a given type into an Array, you can save the Html definition instead.
Example :
$TypeDef['boolean'] = '<select name="xxx"><option value="1">TRUE</option><option value="0">FALSE</option></select>';
$TypeDef['onoff'] = '<select name="xxx"><option value="1">ON</option><option value="0">OFF</option></select>';
$TypeDef['varchar'] = '<input type="text" name="xxx">';
|
And your field list:
$FieldLst[] = array('name'=>'field.a','type'=>'boolean');
$FieldLst[] = array('name'=>'field.b','type'=>'onoff');
$FieldLst[] = array('name'=>'field.c','type'=>'varchar');
|
You just have to find a little tric to replace xxx by the field name.