Categories > TinyButStrong general >

Reusing a Block (multible selects with the same content for example)

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Andreas E.
Date: 2009-04-26
Time: 14:30

Reusing a Block (multible selects with the same content for example)

Here is an example of a code that actually "works", but after some research it might aktually be a bug and not yet supported. Because if I try to use an other block "inside" the treemenublock only one line is rendered.
So the code stays the same, but replacing pagesblock with categorysblock for example does not work.
I know I could just create a multidimensional array with the same array repeaded as a subblock. But I see no reason why the code below shouldn't work?

<table>
<tr>
    <td>[treemenublock.name;block=tr]</td>
    <td>
        <select name="page_id[]" class="autowidth">
            <option value='-1'>&nbsp;</option>
            <option style="padding-left:[pagesblock.depth;ope=add:-1,mul:16]px" value='[pagesblock.id]'[treemenublock.page_id;if [val]=[pagesblock.id];then ' SELECTED'; else '']>[pagesblock.title;block=option;ifempty='-No Title-']</option>
        </select>
    </td>
</tr>
</table>
By: Andreas E.
Date: 2009-04-26
Time: 18:35

Re: Reusing a Block (multible selects with the same content for example)

Ok forgett it,
I just found the solution.

You aktually have to merge the block inside befor the outer block. This seams to clone the block, in my case the pagesblock and you are able to reuse the same block multible times.