Categories > TinyButStrong general >

wired behavior of if statement

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Peter Schade
Date: 2005-08-04
Time: 11:06

wired behavior of if statement

Hello!

I have an db field homepagename wich data is "Märchen".

here is the code of html site:
<TD>[hplogozeig;if [val]==0;then <h1>[homepagename]</h1>;else <img src='[hplogo]' alt='[homepagename]'>;htmlconv=no]</TD>

if i generate the site it only replys:
<TD><h1>M&auml</TD>

Is it a bug or have i understand something wrong?

Bye Peter
By: Skrol29
Date: 2005-08-04
Time: 11:12

Re: wired behavior of if statement

Probably a problem of quotes, try:
<TD>[hplogozeig;if [val]==0;then '<h1>[homepagename]</h1>';else '<img src="[hplogo]" alt="[homepagename]">';htmlconv=no]</TD>
By: Peter Schade
Date: 2005-08-04
Time: 11:18

Re: wired behavior of if statement

Yes this works, but if i use an string with ' it gets borked...

<TD>'<h1>M&auml;rchen 's</h1>';else '<img src="../uploads/" alt="M&auml</TD>
By: Skrol29
Date: 2005-08-04
Time: 11:25

Re: wired behavior of if statement

Yes, that's why you can also escape the quotes :

  [homepagename;htmlconv=esc]
By: Peter Schade
Date: 2005-08-04
Time: 11:34

Re: wired behavior of if statement

Thank you for your prompt help.