Categories > TinyButStrong general >

Sub-blocks problems

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Cactusbone
Date: 2006-05-11
Time: 22:08

Sub-blocks problems

hello there, i'm having problems with sub blocks:

here's html templates :

[menu;block=begin]
<table>
    <tr>
        <td>[menu.titre]</td>
    </tr>
    <tr>
        <td><a href="[bouton.adr;block=tr;pos=[menu.$]]" [bouton.target]>[bouton.nom]</a></td>
    </tr>
</table>
<br />
[menu;block=end]
and here's php side :
$TBS->MergeBlock("menu", $categories);
$TBS->MergeBlock("bouton", 'array', 'boutons[%pos%]');

input table :
Array categories
(
    [0] => Array
        (
            [titre] => test
        )

    [1] => Array
        (
            [titre] => omg
        )

)
Array boutons
(
    [test] => Array
        (
            [0] => Array
                (
                    [nom] => kikoo
                    [adr] => #
                    [target] =>
                )

            [1] => Array
                (
                    [nom] => yop
                    [adr] => #
                    [target] =>
                )
        )
    [omg] => Array
        (
            [0] => Array
                (
                    [nom] => a
                    [adr] => #
                    [target] =>
                )

            [1] => Array
                (
                    [nom] => b
                    [adr] => #
                    [target] =>
                )
        )
)

my problem is only the first cell of "categories" is displayed ... no "bouton" cells ...

thx for any help provided
By: Skrol29
Date: 2006-05-12
Time: 01:16

Re: Sub-blocks problems

Hello,

I can see serveral problems:
- "pos" is not the correct parameter. it should be "p1".
- [menu.$] is not the correct value to retrieve the item in buton, it should be [menu.titre].

HTML:
[bouton.adr;block=tr;p1=[menu.titre]]

And the PHP side:
$TBS->MergeBlock("menu", $categories);
$TBS->MergeBlock("bouton", 'array', 'boutons[%p1%]');


By: Cactusbone
Date: 2006-05-12
Time: 02:32

Re: Sub-blocks problems

thx, it works better but not completely, i made the changes you suggested and now i have both categories showing but only boutons for the 1st categories and none for the other
By: Skrol29
Date: 2006-05-14
Time: 01:36

Re: Sub-blocks problems

Could you send to me a code example to reproduce your behavior ?
By: Cactusbone
Date: 2006-05-14
Time: 12:25

Re: Sub-blocks problems

http://cactusbone.free.fr/tbs/test.zip

playing with it a bit , it seems the object menu creates the problem, dunno why.

btw, under firefox the popup to reply is not large enough and you can't see what you're typing at the end of lines
By: Skrol29
Date: 2006-05-15
Time: 11:06

Re: Sub-blocks problems

Hello,

What is you TBS version ?
By: Skrol29
Date: 2006-05-15
Time: 13:39

Re: Sub-blocks problems

Hi,

That was a TBS 3.0 bug. It is fixed now with TBS 3.0.4, available yet for download.
Thanks to have taken time to give information to fix this problem.
By: Cactusbone
Date: 2006-05-15
Time: 16:52

Re: Sub-blocks problems

sure, no problems :) thanks for the fix