Categories > TinyButStrong general >

strange conditional (block) behaviour

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Gu
Date: 2006-09-29
Time: 13:38

strange conditional (block) behaviour

hi to all!

in a template of mine i have this part:
..
    <div id = "locazione">
        <div id = "locazione_titolo">[var.nome_locazione]</div>
        <br />
        <div id = "eventi">
        [onload;block=div;when [var.eventi]!='']
            <div id = "annunci">[onload;block=div;when [var.annunci]!= ''][var.annunci;htmlconv=no]</div>           
            <div id = "eventi_html">[var.eventi;htmlconv=no]</div>               
        </div>
        [onload;file=loc/[var.pg.locazione].htm]
        <br />
        <div>
            [onload;block=div;when [var.si_trovano_qui]!='']
            <b>Si trovano qui:</b><br />
            [var.si_trovano_qui;htmlconv=no]
            <br />
        </div>

    </div>
..

now, the first div blocks work great. if the string variables ($eventi etc) are not empty ( !='') the blocks are shown, otherwhise they're not.

the last block ( [onload;block=div;when [var.si_trovano_qui]!=''] ), though, doesn't work for some strange reason. i've tried various tests manually assigning different values (empty or not) to the variable $si_trovano_qui, but it never shows.

trying the "onloadX" method (to see what it is comparing) i obtain the following code:

        <div>
            [onloadX;block=div;when &lt;a href = #&gt;Ert&lt;/a&gt;&lt;br /&gt;!='']
            <b>Si trovano qui:</b><br />

            <a href = #>Ert</a><br />
            <br />
        </div>

can anyone help?
By: Skrol29
Date: 2006-10-01
Time: 10:51

Re: strange conditional (block) behaviour

Hi,

It appears that your variable $si_trovano_qui contains the string "<a href = #>Ert</a><br />" when this last onload block is merged.

If you d'ont know why tihs variable has such a value, check if it can be because of the subtemplate insterted by [onload;file=...]. You can use the [onloadX] for this check.