Export plug-in for TinyButStrong
by Mick@el, 2007-06-12

The Export plugins allows you to "export" a block's field to the outside of the block.

Example :

PHP side :
include 'tbs_class.php';
include 'tbs_plugin_export.php';

$TBS = new clsTinyButStrong; // The TBS engine
$TBS->LoadTemplate('my_template.tpl'); // Open our template file

$data = Array
(
    Array('name' => 'John', 'age' => '24'),
    Array('name' => 'Bob', 'age' => '35'),
    Array('name' => 'Jordan', 'age' => '14')
);

$TBS->MergeBlock('blk_test', $data); // Merge the block
$TBS->Show(); // Show the merged template

Requirements :

Include the file 'tbs_plugin_export.php'.
This plug-in has been built for TBS version 3.2.0 or higher but should work with older versions (3.x).


Installation mode : The plug-in is installed automatically.

Template side :

People List :

Name Age
[blk_test.name; block=tr; export] [blk_test.age]

First name : [blk_test[0].name]
First age : [blk_test[0].age]

Second name : [blk_test[1].name]
Second age : [blk_test[1].age]

Third name : [blk_test[2].name]
Third age : [blk_test[2].age]


Merged template :

People List :

Name Age
John 24
Bob 35
Jordan 14

First name : John
First age : 24

Second name : Bob
Second age : 35

Third name : Jordan
Third age : 14


Remark : The export parameter can also specify the maximum number of records to export.

Example :

People List :

Name Age
[blk_test.name; block=tr; export=2] [blk_test.age]

First name : [blk_test[0].name]
First age : [blk_test[0].age]

Second name : [blk_test[1].name]
Second age : [blk_test[1].age]

Third name : [blk_test[2].name]
Third age : [blk_test[2].age]


Merged template :

People List :

Name Age
John 24
Bob 35
Jordan 14

First name : John
First age : 24

Second name : Bob
Second age : 35

Third name : [blk_test[2].name]
Third age : [blk_test[2].age]

The last two fields hasn't been merged because the export parameter is set to 2.

Changelog :

Version 1.0.0 : First release.