Categories > TinyButStrong general >

nested blocks??

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Iarus
Date: 2006-07-27
Time: 23:35

nested blocks??

Hello, I've been using TBS since... last week, and it's awesome!

I want to nest two blocks, but I dont understand how to do it.

I want to have a bunch of big divs wich contains other divs, a table,... and inside the table I have a select with it's options that are different from a big div to an other.

HTML
...
<div>
   <div id="[bigBlock.id;block=((div));]">
      ...
   </div>
   ...
   [bigBlock.someField;]
   ...
   <form>
      <table><tr><td>
         <select>
            <option    value="[optionsBlock.id;block=option;]">[optionsBlock.name;]<option>
         </select>
      </td></tr></table>
   </form>
</div>
...

PHP
...
select stuff from my database
while($row = $res->FetchRow())
{
   here I build an $array from what's in $row

   array_push($arrayBigBlock, $array);

   from one field of $row, I build an $arrayOptions wich contains data to fill my select (combo box)
   $TBS->MergeBlock('optionsBlock', 'array', $arrayOptions);
}

$TBS->MergeBlock('bigBlock', 'array', $arrayBigBlock);
...

obviously it doesn't work, or else I would not be asking for help, so ... HELP!

thanks
By: TomH
Date: 2006-07-28
Time: 00:50

Re: nested blocks??

Look again at the "TBS Examples" called "Groupings (headers, ...)" this may do exactly the way you wan't, and it is very easy to use.

--- if not, come back here and just explain what it doesn't do that you need to do.