By: Pyhak Ise
Date: 2004-10-14
Time: 10:11
|
serial + Explicit Syntax
Hi
First of all, TBS is the best template system I ever tried.
ok, here's a question:
Can I use serial with begin and end blocks?
like:
<table border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#3399CC">
<tr>
<td>[mb;block=tr;serial][mb_1.Name;block=td]<br>
<table border="1" align="center" cellpadding="2" cellspacing="0">
<tr bgcolor="#F0F0F0">
<td>[cb.Name;block=tr;p1='[mb_1.HID]']</td>
</tr>
</table>
</td>
<td>[mb_2.Name;block=td]
<table border="1" align="center" cellpadding="2" cellspacing="0">
<tr bgcolor="#F0F0F0">
<td>[cb.#]</td>
<td>[cb.Name;block=tr;p1='[mb_2.HID]']</td>
</tr>
</table>
</td>
</tr>
</table>
|
php:
$TBS->MergeBlock('mb',$con_id,"SELECT Name_et as Name,ID as HID FROM First group by ID");
$TBS->MergeBlock('cb',$con_id,"SELECT Name_et as Name from Second where ID='%p1%'");
|
with "tag_blocks" it works perfect but..it seems like block=end ends loop.
|
By: Skrol29
Date: 2004-10-14
Time: 13:28
|
Re: serial + Explicit Syntax
Hello,
It works perfectly for me.
Your template should be:
<table border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#3399CC">
[mb;block=begin;serial]
<tr>
[mb_1;block=begin]
<td>[mb_1.Name]<br>
<table border="1" align="center" cellpadding="2" cellspacing="0">
<tr bgcolor="#F0F0F0">
<td>[cb.Name;block=tr;p1='[mb_1.HID]']</td>
</tr>
</table>
</td>
[mb_1;block=end]
[mb_2;block=begin]
<td>[mb_2.Name]
<table border="1" align="center" cellpadding="2" cellspacing="0">
[cb;block=begin;p1='[mb_2.HID]']
<tr bgcolor="#F0F0F0">
<td>[cb.#]</td>
<td>[cb.Name]</td>
</tr>
[cb;block=end]
</table>
</td>
[mb_2;block=end]
</tr>
[mb;block=end]
</table>
|
|
By: Pyhak Ise
Date: 2004-10-14
Time: 14:28
|
Re: serial + Explicit Syntax
Thank You!
Got it :)
My point was to get rid of cells and your example helped me out.
|
|
Posting in progress.
Please wait...
|