Categories > TinyButStrong general >

onsection question

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: michael
Date: 2004-08-30
Time: 09:24

onsection question

Hi

I think I need to use onformat & I think I am ok - however at first I tried onsection, and couldn't get it to work.. wonder if I did something wrong.

Here is how I set up the HTML template with onsection:

                <tr>
                    <td width="35%">[menuitem.description;block=tr] <font color="#00A600"><b>[menuitem.subdescription]</b></font></td>
                    <td width="15%">[menuitem.price;frm=$0.00]</td>
                    <td width="25%">[menuitem.tagline]</td>
                    <td width="5%">[menuitem.available;onsection=test]</td>
                    <td width="25%">edit | delete</td>
                </tr>

and here is the relevant PHP section - I basically just copied from the example:

test($BlockName,&$CurrRec,&$DetailSrc,$RecNum){
//$BlockName : name of the block that calls the function (read only)
//$CurrRec   : array that contains columns of the current record (read/write)
//$DetailSrc : source of the current section (read/write)
//$RecNum    : number of the current record (read only)
if ($RecNum==1) $CurrRec['description'] = $CurrRec['description']. ' (WINS)' ;
}

but I saw no change to the description column in the first row. Did I do something silly?

Thanks

Michael.
By: Skrol29
Date: 2004-08-30
Time: 12:13

Re: onsection question

onsection is a parameter for blocks. It as to be put in the same TBS tag that defines the block. The one which has 'block=tr'.
By: GypsumBlue
Date: 2005-08-15
Time: 19:15

Re: onsection question

Made exactly the same mistake. Completely missed this reading the manual. Thanks Skrol.