Categories > TinyButStrong general >

Condition whith file inclusion

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Jose Carlos
Date: 2003-09-09
Time: 02:39

Condition whith file inclusion

Hi,

TS is very powerful but a bit difficult :)

I need this,, is it possible ?

<table>
{ if login  show below  }
<tr>
  <td>
     {include of file login.htm}
  <td>
</tr>
{ end if}
{ else  show below}
<tr>
  <td>
      tables  images,  include of file  and others things
  <td>
  <td>
      include of file main.htm  or other page
  <td>
</tr>
{endif}
</table>

Thanks
By: Skrol29
Date: 2003-09-09
Time: 22:17

Re: Condition whith file inclusion

Hello Jose,

Yes you can do this with TBS.

The more simple is to prepare a PHP variable wich is 1 if the login is ok, end otherwise it is 0.

For the login.htm file to include, you can use a simple [tbs_include] field with a 'if' paremeter.
example : [tbs_include.onshow;file=login.htm;if [var.login]=1]

For the en of the tabl, you can use another [tbs_include] filed with a 'if' paremeter and which points on a sub-template.

Or you can use a [tbs_check] block if you want to keep the end of the table in the same template.

Hope it has helped.
By: Jose Carlos
Date: 2003-09-10
Time: 04:24

Re: Condition whith file inclusion

Hi,  

but how works a block in [tbs_check]?

is it possible to define a block whith begin and end ?
like this :

  [tbs_check;if pag=´login´]
    <tr><td> [tbs_include.onshow;file=login.htm;]</td</tr>
    [tbs_check;else]
     <tr><td> A lot of thngs,, a menu and other tables
       [tbs_include.onshow;file=pag;]
     </td</tr>
    [tbs_check;endif]