By: Rudy
Date: 2010-04-04
Time: 13:59
|
Automatically merge block with empty array before/onShowHello,
Is there any way to have a block merged with an empty array automatically onshow by only defining this in the template? I have the following situation: In an application there is one template which has regular merged fields and blocks and some that can't be merged before show because ajax should do that by loading the samte template and using getblocksource, then merging the data and returning only one of the blocks. But for this to work those blocks need to be merged with an empty array to avoid invalid html for javascript-operations after onshow - and to show that we are just loading those parts. Example: HTML:
Is it possible to add some onformat or such to process the blocks with a special parameter before show to not need to merge the blocks manually with an empty array? Thanks for any tips Rudy |
||
By: Skrol29
Date: 2010-04-05
Time: 22:20
|
Re: Automatically merge block with empty array before/onShowHi Rudy,
I can see at least 2 solutions. 1st solution: Use property Assiged to prepare the blocks to be merged automatically on the OnShow event. See http://tinybutstrong.com/forum.php?msg_id=10440# 2st solution: Define onshow conditional blocks that have the same bounds that the blocks to delete. And use a conditional expression that is always false in order to have the blocks deleted in any case. Example:
|
||
By: Rudy
Date: 2010-04-05
Time: 22:36
|
Re: Automatically merge block with empty array before/onShowHi Skrol29,
thanks for your reply. I use assigned a lot, but it would not make any difference assigning them or merging them with an empty array, both solutions need changes to the PHP code when new blocks are added. Your second solution looks promising, but i see one problem: when ajax merges the block "list" the [onshow;.. directives will be multiplied along the rows and the result will be empty (the external script needs a "$tbs->show()" too and can't just output $tbs->Source) Is it possible to delete the [onshow;block=tr+tr;when 0=1] during the mergeblock of "list"? |