Categories > TinyButStrong general >

Grouping error

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: EmilCf
Date: 2007-09-18
Time: 10:51

Grouping error

This is my PHP data & html :


PHP:

$array_[] = array('title'=>'t1', 'content'=>'a');
$array_[] = array('title'=>'t1', 'content'=>'b');
$array_[] = array('title'=>'t1', 'content'=>'c');

$array_[] = array('title'=>'t2', 'content'=>'a2');
$array_[] = array('title'=>'t2', 'content'=>'b2');
$array_[] = array('title'=>'t2', 'content'=>'c2');


HTML :



[test.title; block=begin; headergrp=title]
<div>[test.title; headergrp=title]</div>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr>
    <td>[test.content; block=tr; headergrp=content]</td>
</tr>
</table>
[test.title; block=end; headergrp=title]


-----------------------------------[End of code]



I though TBS will output :

<div>t1</div>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr>
    <td>a</td>
</tr>
<tr>
    <td>b</td>
</tr>
<tr>
    <td>c</td>
</tr>
</table>


<div>t2</div>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr>
    <td>a2</td>
</tr>
<tr>
    <td>b2</td>
</tr>
<tr>
    <td>c2</td>
</tr>
</table>


However, the result is :



<div>t1</div>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr>
    <td>a</td>
</tr>
</table>

<div>t2</div>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr>
    <td>a2</td>

</tr>
</table>





What's wrong with my html code? Thanks....@__@"
By: Skrol29
Date: 2007-09-18
Time: 15:27

Re: Grouping error

Hi,

You cannot use embeded TBS sections, only if you use "pargentgrp" but it can have only one level.
Your HTML should be:
[test;block=begin;parentgrp=title]
  <div>[test.title]</div>
  <table border="1" width="100%" cellspacing="0" cellpadding="0">
    <tr>
      <td>[test.content;block=tr]</td>
    </tr>
  </table>
[test;block=end]

The same using the relative syntax:
  <div>[test.title;block=div+table;parentgrp=title]</div>
  <table border="1" width="100%" cellspacing="0" cellpadding="0">
    <tr>
      <td>[test.content;block=tr]</td>
    </tr>
  </table>
By: EmilCF
Date: 2007-09-18
Time: 17:45

Re: Grouping error

Thanks Skrol29!