Categories > TinyButStrong general >

Unexpected result with parentgrp and headergrp/footergrp

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Rudy
Date: 2009-12-08
Time: 20:40

Unexpected result with parentgrp and headergrp/footergrp

Hi,

I recently found that combining parentgrp and headergrp leads to an unexpected result. Consider having following data (pastie): http://pastie.org/734110

That is: state > country > region > city.

I used the following template:
<div class="state">
  <h1>[data.state;block=div;parentgrp=state]</h1>
  <div class="country">
    <h2>[data.country;block=div;parentgrp=country]</h2>
    <table>
        <tr class="region"><th><h3>[data.region;headergrp=region]</h3></th></tr>
        <tr class="city"><td>[data.city;block=tr]</td></tr>
        <tr class="region-footer"><th><em>end of [data.region;footergrp=region]</em></th></tr>
      </table>
  </div>
</div>

State and country have to reside in their own <div>'s for styling purposes, I assume parentgrp would be right for that.

Within the table I need a header showing the region's name, this then would be a headergrp. For checking purposes I also added a footergrp just displaying the same regionname.

There are 3 states, each of which has 3 countries, each with 3 regions with 3 cities.

I would expect a list in following order:
stateA
countryAA
   regionAAA
     cityAAAA
     cityAAAB
     cityAAAC
   end of regionAAA
   regionAAB
     cityAAAA
     cityAAAB
     cityAAAC
   end of regionAAB
   regionAAC
     cityAAAA
     cityAAAB
     cityAAAC
   end of regionAAC
countryAB
   regionABA
   ....

but the result is:

stateA
countryAA
   regionAAA
     cityAAAA
     cityAAAB
     cityAAAC
     cityAAAA
     cityAAAB
     cityAAAC
     cityAAAA
     cityAAAB
     cityAAAC
   end of regionAAC
countryAB
   regionABA
   ....

Is the combination of parentgrp and headergrp not allowed, did I miss something or is it buggy?

Thanks.
Rudy


By: Rudy
Date: 2009-12-08
Time: 20:45

Re: Unexpected result with parentgrp and headergrp/footergrp

Never mind, I missed block=tr in the headergrp and footergrp. Really creative. Would have saved me work seeing this earlier :) Thanks anyways.
By: Skrol29
Date: 2009-12-09
Time: 10:31

Re: Unexpected result with parentgrp and headergrp/footergrp

:)