TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

display block more than once

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: yazul
Date: 2013-01-24
Time: 16:49

display block more than once

in a template, i want to use a block more than once.

[theName;block=begin][theName.code]...[theName;block=end]
[theName;block=begin][theName.name]...[theName;block=end]

but TBS seems to ignore first "end" et second "begin" , and constructs an unique block...

any idea ?
By: Sarah
Date: 2013-01-24
Time: 19:51

Re: display block more than once

Have you tried including parameter p1? E.g.

[theName;block=begin;p1][theName.code]...[theName;block=end]
[theName;block=begin;p1][theName.name]...[theName;block=end]

From the manual:
Merging several blocks with the same data:

You cannot merge several blocks having the same names because they are considered by TBS has a one and only block composed of several sections. Nevertheless, you can use a tip to get a similar behavior.
If you use parameter p1 without value in the block definition, that does forces TBS to consider the section as a new block break, like it does for subblocks.

Example:

Id    Name
[b.id;block=tr;p1]    [b.name]
Id    Name
[b.id;block=tr;p1]    [b.name]
$TBS->MergeBlock('b','mysql','SELECT * FROM MyTable');

Versioning: this tip is available since TBS version 3.4.
By: yazul
Date: 2013-01-24
Time: 20:36

Re: display block more than once

Thanks,

I missed that in documentation :-(
By: Sarah
Date: 2013-01-24
Time: 20:37

Re: display block more than once

No worries, I missed it too. Skrol pointed it out for one of my many questions :)