By: jordi
Date: 2009-04-19
Time: 17:18
|
Repeat a block twice with a single MergeBlockCan I repeat the same block twice in the same template?
i.e PHP:
HTML:
In the tag cloud I would like to repeat all the array traversal , i.e. reset the array and repeat all the array. Now I solve am solving it like this: PHP:
Can it be solved with just one MergeBlock? |
|||
By: TomH
Date: 2009-04-19
Time: 19:06
|
Re: Repeat a block twice with a single MergeBlockTry
|
|||
By: Skrol29
Date: 2009-04-19
Time: 21:57
|
Re: Repeat a block twice with a single MergeBlockHi Jordi,
Two blocks cannot have the same name. But you can merge several blocks with one MergeBlock(). HTML:
PHP:
|
|||
By: TomH
Date: 2009-04-19
Time: 23:46
|
Re: Repeat a block twice with a single MergeBlockSkrol,
I tested my proposed solution above and it does work. Should it not work? - or do I misunderstand precisely what you mean in your post. |
|||
By: jordi
Date: 2009-04-20
Time: 11:17
|
Re: Repeat a block twice with a single MergeBlockTom thanks but I didn't explain myself properly. I wanted (more or less):
with myarr for i = 1 to 10 print myarr[i] next with myarr for i = 1 to 10 print myarr[i] next |
|||
By: jordi
Date: 2009-04-20
Time: 11:26
|
Re: Repeat a block twice with a single MergeBlockThank you Skrol29!
I haven't looked at how TBS works internally. Now I can get the idea. It's a good shortcut merging several blocks in one MergeBlock. My question was because I use TBS to generate apache, bind and other .CONF config files and I have different templates that mix and match on differents servers. If I could reset an array, I could use the same array of records in different places without messing with the array ID. Now I keep every variable in an array and increment it in each use which complicates the process a little. If TBS parses the template in a linear way, it would be great to have an additional parameter RESET/REWIND in the Block Syntax, i.e.: [block1;block=begin;RESET] or [block1;block=tr;REWIND] so that TBS could ReMerge or reset the array and process it again. Thank you very much, wonderful support! |
|||
By: jordi
Date: 2009-04-20
Time: 11:29
|
Re: Repeat a block twice with a single MergeBlockBTW, I know TBS is a PHP template system. I started using it for a few small websites coming from WML (http://thewml.org/) and now I use it with PHP-CLI for every template system I need.
Regards. |
|||
By: Skrol29
Date: 2009-04-20
Time: 23:56
|
Re: Repeat a block twice with a single MergeBlockHi TomH,
I didn't see your reply, probably because I posted mine only two hours after you without refreshing my browser. Your solution give a different result. With your snipper the <h1> tags are repeated. I thing Jordi don"t want them repeated. |
|||
By: jordi
Date: 2009-04-21
Time: 03:41
|
Re: Repeat a block twice with a single MergeBlockRight! I don't want that H1 repeated.
Have you thought about [block1;block=tr;REWIND]? Regards. |