Categories > TinyButStrong general >

problem for showing different links...

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Javand
Date: 2008-06-25
Time: 17:07

problem for showing different links...

Hi guys:
I'm new using TBS and I have the next problem:

In my php file I have:

<%php
if($ruta==1)
{
$links="[act_internos.confirmacion;if [val]='Sin Confirmar';then <ahref='index_admin.php?opc=1&text=form_act_asistencia
&accion=confirmar&id_acta=[var.id_acta]&id_asistente=[act_internos.id_asistente_int]&opboton'>[val]</a>;
if [val]='Asiste';then <a href=\"#\">[val]</a>if [val]='No Asiste';then <a href=\"#\">[val]</a>]";
}

if($ruta==2)
{
    $links="[act_internos.confirmacion]";
}
%>

My html file:

<tr>
          <td class=contenidotabla>[act_internos.nombre;block=tr]</td>
          <td class=contenidotabla>[act_internos.cargo]</td>
      <td class=contenidotabla align="center">[var.links]</td>
</tr>

I want that the var [var.links] dosn't show:
"[act_internos.confirmacion;if [val]='Sin Confirmar';then <ahref='index_admin.php?opc=1&text=form_act_asistencia
&accion=confirmar&id_acta=[var.id_acta]&id_asistente=[act_internos.id_asistente_int]&opboton'>[val]</a>;
if [val]='Asiste';then <a href=\"#\">[val]</a>if [val]='No Asiste';then <a href=\"#\">[val]</a>]"

I want to see a list of: "Sin confirmar" or "Asiste" or "No Asiste" as a list.

thanks
By: Skrol29
Date: 2008-06-27
Time: 09:33

Re: problem for showing different links...

Hi Javad,

The TBS tags that you define in your global variables are not processed because [var] fields are merged at the end of the merging. That is when you call $TBS->Show().
You can chnage that by using [onload] fields instead of [var] fields, but the value must be ready when the template is loading.

The other reason is because, by default, TBS protects merged values against TBS tag injection. All "[" chars are replaced with "&#91;" which displays the same in HTML.
So you have to unprotect the TBS fields using "protect=no".

But the better way is to not code HTML in the PHP side.
By: Javand
Date: 2008-06-27
Time: 15:46

Re: problem for showing different links...

Hey man, thanks. I could solve the problem.