Categories > TinyButStrong general >

headergrp, footergrp and splittergrp

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: skey
Date: 2007-11-17
Time: 06:46

headergrp, footergrp and splittergrp

i am a Beginner.

headergrp, footergrp and splittergrp

i don't understand the 3 what distinct. Can you give me example?

My English isn't good.i hope you can understand my question.
By: Pirjo Posio
Date: 2007-11-17
Time: 16:58

Re: headergrp, footergrp and splittergrp

Hi skey,

There is an example of the different groupings at the Examples page. See the example named Groupings (header...).
As the example there shows, you can have several levels of headergrp, and the order of those is important.
Generally, as I understand these, the headergrp is displayed before the block data.
The footergrp is displayed after the block data.
The splittergrp is displayed between the block data, that is, after every block, but not after the last block.
By: sheepy
Date: 2007-11-20
Time: 04:44

Re: headergrp, footergrp and splittergrp

Although you may already know it, I'd like to stress that all three groups has to be associated with a field and are displayed *only when the associated field change value*.
By: Wilfred
Date: 2007-11-21
Time: 11:17

Re: headergrp, footergrp and splittergrp

Related to this is 'parentgrp'. I can't quite get my head around this concept and there is no example. Can anyone explain?
By: TomH
Date: 2007-11-21
Time: 13:11

Re: headergrp, footergrp and splittergrp

Here's the source from my example "Content Management System" at http://tomhenry.us/tbs3/ --- this snippet populates three columns with db rows where each record has the field 'position' that tells us where tp place that item in either col1, col2 col3 respectively. The 'parentgrp=position' defined at the inner table/class attribute and defines its 'block=td' which is the column of the outer table - which is the container for the inner table. So... when the value of 'position' changes from col1 to col2 TBS creates another <td> to be the column for the next group of records (each one being a separate <table>).

  <table width="99%" border="0" align="left" cellpadding="0" cellspacing="0">
  <tr>
  
<!-- parentgrp repeats this td block on change value of 'position' -->
  <td class="col_[blk.position]" width="200" valign=top>

    <table  class="[blk.position;block=td;parentgrp=position]" width="100%" cellspacing="0" cellpadding="0" border="0">
<!-- blk.categurl  is the name of the subtemplate file in the db -->
<tr>
<!-- here repeats inner block=table for each set of 'position' rows -->
<td class="[blk.category]">
[blk.id;script=[blk.categurl];subtpl;block=table]
</td>
</tr>
    </table> 

    </td>
  </tr>
  </table>

It's important to remember that the block definition for the parentgrp (in this case the <td>) has to wrap around the html for the inner block (in this case the inner <table>) in order for this to work. That's why I place the 'parentgrp=position' in the inner table's <table>.

You can see examples of the use of headergrp shown in the other example "MyInventoryDemo" on the Catalog page.

Keep in mind that the genius is all TBS design -- the rest of us are just learning how to use it from Skrol29.

Hope that helps, if it's not clear enough - keep asking!
TomH